1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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;
|