diff --git a/src/Components/MaterialCard.js b/src/Components/MaterialCard.js index ae90a16f8375fef7d4b2b5e111ca7fc700f6e0d2..18c37b4d4cad65e798a61f9c3926f60126e8c4a5 100644 --- a/src/Components/MaterialCard.js +++ b/src/Components/MaterialCard.js @@ -28,14 +28,15 @@ import Grid from '@material-ui/core/Grid'; import styled from 'styled-components'; import Button from '@material-ui/core/Button'; import ExpandMoreRoundedIcon from '@material-ui/icons/ExpandMoreRounded'; -import ExpandLessRoundedIcon from '@material-ui/icons/ExpandLessRounded'; export default function MaterialCard(props) { - const [expanded, setExpanded] = useState(false); - const thumb = require(`../../public/${props.thumb}`) + const HandleButtonPressed = () => { + props.handleExpand(props.id); + } + return ( <Card> <img src={thumb} alt="thumbnail do recurso" /> @@ -68,11 +69,11 @@ export default function MaterialCard(props) { <CardActions style={{ borderTop: "1px solid #e5e5e5", justifyContent: "center" }}> <Button color="secondary" - endIcon={expanded ? <ExpandLessRoundedIcon/> : <ExpandMoreRoundedIcon/>} - onClick={() => props.handleExpand(props.id)} + endIcon={<ExpandMoreRoundedIcon/>} + onClick={HandleButtonPressed} > - Ver módulos + Ver módulos </Button> </CardActions> </Card >