diff options
author | Eug-VS <eug-vs@keemail.me> | 2020-01-03 02:21:54 +0300 |
---|---|---|
committer | Eug-VS <eug-vs@keemail.me> | 2020-01-03 02:22:28 +0300 |
commit | 15cf186e8b5ef25188df92be18d421a486033ee2 (patch) | |
tree | f8a66f4c60176cf8c3d759bbd68a26642b07283a /src/components/Scoreboard/Solution.js | |
parent | 3cc00d726e40886d64b2554fb0c48571621d4191 (diff) | |
download | chrono-cube-ui-15cf186e8b5ef25188df92be18d421a486033ee2.tar.gz |
Apply styles to the Scoreboard
Diffstat (limited to 'src/components/Scoreboard/Solution.js')
-rw-r--r-- | src/components/Scoreboard/Solution.js | 76 |
1 files changed, 58 insertions, 18 deletions
diff --git a/src/components/Scoreboard/Solution.js b/src/components/Scoreboard/Solution.js index 3f46eb5..6f87723 100644 --- a/src/components/Scoreboard/Solution.js +++ b/src/components/Scoreboard/Solution.js @@ -1,32 +1,72 @@ import React from 'react'; import { - Card, - CardContent, Typography, - Paper, + Card, + Container, + Box, + ExpansionPanelSummary, + ExpansionPanel, + ExpansionPanelDetails, } from "@material-ui/core"; -import styled from "styled-components"; +import { makeStyles } from "@material-ui/core/styles"; +import TimerIcon from '@material-ui/icons/Timer'; +import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; + + +const useStyles = makeStyles(theme => ({ + item: { + backgroundColor: theme.palette.secondary.dark, + margin: theme.spacing(3), + width: theme.spacing(60), + + '& .MuiBox-root': { + display: 'flex', + justifyContent: 'center', + alignItems: 'center', + }, + + '& .MuiTypography-h2': { + color: theme.palette.orange.main, + margin: theme.spacing(2), + }, + }, + +})); const Solution = ({ solution }) => { + const classes = useStyles(); const author = solution.author? solution.author : 'anonymous'; return ( - <PaperWrapper elevation={2} style={{backgroundColor: "#ddbea3"}}> - <Typography variant="h4" style={{fontWeight: "bold"}}> - { solution.result } - </Typography> - <Typography> - by {author} - </Typography> - </PaperWrapper> + <Card elevation={4} className={classes.item}> + <Container maxWidth="xs"> + <Box> + <TimerIcon/> + <Typography variant="h2"> + { solution.result } + </Typography> + </Box> + </Container> + + <ExpansionPanel> + <ExpansionPanelSummary expandIcon={<ExpandMoreIcon style={{color: 'white'}}/>}> + <Typography variant="h6"> + By {author} + </Typography> + </ExpansionPanelSummary> + <ExpansionPanelDetails> + <Typography> + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Suspendisse malesuada lacus ex, sit amet blandit leo lobortis eget. + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Suspendisse malesuada lacus ex, sit amet blandit leo lobortis eget. + </Typography> + </ExpansionPanelDetails> + </ExpansionPanel> + </Card> ) }; -const PaperWrapper = styled(Card)` - padding: 10px; - margin: 25px; -`; - -export default Solution;
\ No newline at end of file +export default Solution; |