Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PortalMEC-React
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Harbor Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PortalMEC
PortalMEC-React
Commits
b9ade710
Commit
b9ade710
authored
4 years ago
by
lfr20
Browse files
Options
Downloads
Patches
Plain Diff
Add a logic to display an icon only when a function is received by prop
parent
e68c706d
No related branches found
No related tags found
4 merge requests
!57
Merge of develop into master
,
!56
Fixed buttons reportar, seguir, compartilhar, guardar and entrar (in comments...
,
!40
merge admin into develop
,
!37
Merge sistema_admin into Update_Admin_System
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Admin/Components/Components/Table.js
+22
-19
22 additions, 19 deletions
src/Admin/Components/Components/Table.js
with
22 additions
and
19 deletions
src/Admin/Components/Components/Table.js
+
22
−
19
View file @
b9ade710
import
React
from
'
react
'
;
import
React
from
'
react
'
;
// material ui componets
import
Table
from
'
@material-ui/core/Table
'
;
import
{
withStyles
,
makeStyles
}
from
'
@material-ui/core/styles
'
;
...
...
@@ -7,7 +7,7 @@ import TableCell from '@material-ui/core/TableCell';
import
TableContainer
from
'
@material-ui/core/TableContainer
'
;
import
TableHead
from
'
@material-ui/core/TableHead
'
;
import
TableRow
from
'
@material-ui/core/TableRow
'
;
import
Paper
from
'
@material-ui/core/Paper
'
;
import
Paper
from
'
@material-ui/core/Paper
'
;
import
FilterListRoundedIcon
from
'
@material-ui/icons/FilterListRounded
'
;
import
{
IconButton
}
from
'
@material-ui/core
'
;
...
...
@@ -26,8 +26,8 @@ const useStyles = makeStyles({
minWidth
:
700
,
},
root
:
{
minWidth
:
275
,
boxShadow
:
'
2px 2px 1px #A9A9A9
'
minWidth
:
275
,
boxShadow
:
'
2px 2px 1px #A9A9A9
'
},
bullet
:
{
display
:
'
inline-block
'
,
...
...
@@ -35,8 +35,8 @@ const useStyles = makeStyles({
transform
:
'
scale(0.8)
'
,
},
title
:
{
fontSize
:
28
,
fontWeight
:
"
500
"
fontSize
:
28
,
fontWeight
:
"
500
"
},
pos
:
{
marginBottom
:
12
,
...
...
@@ -46,29 +46,32 @@ const useStyles = makeStyles({
const
TableData
=
(
props
)
=>
{
const
classes
=
useStyles
();
console
.
log
(
props
.
onIconPressed
)
return
(
<
TableContainer
component
=
{
Paper
}
>
<
Table
className
=
{
classes
.
table
}
aria
-
label
=
"
customized table
"
>
<
TableHead
>
<
TableRow
>
{
props
.
top
.
map
((
top
,
index
)
=>
(
index
===
0
?
<
StyledTableCell
key
=
{
index
}
>
<
div
style
=
{{
display
:
'
flex
'
,
flexDirection
:
'
row
'
,
alignItems
:
'
center
'
}}
>
{
top
}
<
IconButton
onClick
=
{
props
.
onIconPressed
}
color
=
'
primary
'
>
<
FilterListRoundedIcon
style
=
{{
color
:
'
white
'
}}
/
>
<
/IconButton
>
<
/div
>
<
/StyledTableCell>
:
<
StyledTableCell
align
=
"
right
"
key
=
{
index
}
>
{
top
}
<
/StyledTableCell
>
props
.
top
.
map
((
top
,
index
)
=>
(
index
===
0
?
<
StyledTableCell
key
=
{
index
}
>
<
div
style
=
{{
display
:
'
flex
'
,
flexDirection
:
'
row
'
,
alignItems
:
'
center
'
}}
>
{
top
}
{
props
.
onIconPressed
===
undefined
?
<
div
><
/div> : <IconButton onClick={props.onIconPressed} color='primary'
>
<
FilterListRoundedIcon
style
=
{{
color
:
'
white
'
}}
/
>
<
/IconButton
>
}
<
/div
>
<
/StyledTableCell
>
:
<
StyledTableCell
align
=
"
right
"
key
=
{
index
}
>
{
top
}
<
/StyledTableCell
>
))
}
<
/TableRow
>
<
/TableHead
>
{
props
.
children
}
{
props
.
children
}
<
/Table
>
<
/TableContainer
>
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment