diff options
author | Eug-VS <eug-vs@keemail.me> | 2020-01-05 01:57:42 +0300 |
---|---|---|
committer | Eug-VS <eug-vs@keemail.me> | 2020-01-05 01:57:42 +0300 |
commit | 57a8a5dccbc267543799fd01192b2a1534e53c64 (patch) | |
tree | ffd15705c39394257c3f77ccb453441cb77cd400 /src/components/SolutionCard | |
parent | 048f277ef7831b8f1a02c5e6590fb8087862b7fc (diff) | |
download | chrono-cube-ui-57a8a5dccbc267543799fd01192b2a1534e53c64.tar.gz |
Isolate SolutionCard component
Diffstat (limited to 'src/components/SolutionCard')
-rw-r--r-- | src/components/SolutionCard/SolutionCard.js | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/src/components/SolutionCard/SolutionCard.js b/src/components/SolutionCard/SolutionCard.js new file mode 100644 index 0000000..41d61c1 --- /dev/null +++ b/src/components/SolutionCard/SolutionCard.js @@ -0,0 +1,71 @@ +import React from 'react'; + +import { + Typography, + Card, + Container, + Box, + ExpansionPanelSummary, + ExpansionPanel, + ExpansionPanelDetails, +} from "@material-ui/core"; + +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: { + margin: theme.spacing(3), + width: theme.spacing(60), + + '& .MuiBox-root': { + display: 'flex', + justifyContent: 'center', + alignItems: 'center', + }, + + '& .MuiTypography-h2': { + color: theme.palette.secondary.main, + margin: theme.spacing(2), + }, + }, + +})); + +const SolutionCard = ({ solution }) => { + const classes = useStyles(); + + const author = solution.author? solution.author : 'anonymous'; + return ( + <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> + ) +}; + +export default SolutionCard; |