Showing
3 changed files
with
40 additions
and
23 deletions
| 1 | import React from "react"; | 1 | import React from "react"; |
| 2 | import { makeStyles } from "@material-ui/core/styles"; | 2 | import { makeStyles } from "@material-ui/core/styles"; |
| 3 | -import Grid from "@material-ui/core/Grid"; | ||
| 4 | import Container from "@material-ui/core/Container"; | 3 | import Container from "@material-ui/core/Container"; |
| 5 | -import Icon from '@material-ui/core/Icon'; | 4 | +import Grid from "@material-ui/core/Grid"; |
| 5 | +import Icon from "@material-ui/core/Icon"; | ||
| 6 | 6 | ||
| 7 | import TodoCard from "./TodoCard.js"; | 7 | import TodoCard from "./TodoCard.js"; |
| 8 | 8 | ||
| 9 | -const data={ | 9 | +const data = { |
| 10 | - date:"2020-99-99", | 10 | + date: "2020-99-99", |
| 11 | - title:"머휘의 TODO LSIT", | 11 | + name: "daehwi", |
| 12 | - todo:["응가하기","똥싸기","변누기"] | 12 | + isPublic: true, |
| 13 | -} | 13 | + title: "열글자까지가능합니다.", |
| 14 | + todo: ["응가하기", "똥싸기", "변누기"], | ||
| 15 | +}; | ||
| 14 | 16 | ||
| 15 | const useStyles = makeStyles((theme) => ({ | 17 | const useStyles = makeStyles((theme) => ({ |
| 16 | root: { | 18 | root: { |
| 17 | flexGrow: 1, | 19 | flexGrow: 1, |
| 18 | - backgroundColor:"#e9e9e9", | 20 | + backgroundColor: "#e9e9e9", |
| 19 | - paddingTop:"4rem", | 21 | + paddingTop: "4rem", |
| 20 | - marginTop:"0" | 22 | + marginTop: "0", |
| 21 | }, | 23 | }, |
| 22 | item: { | 24 | item: { |
| 23 | marginLeft: "auto", | 25 | marginLeft: "auto", |
| ... | @@ -32,7 +34,7 @@ export default function CenteredGrid() { | ... | @@ -32,7 +34,7 @@ export default function CenteredGrid() { |
| 32 | <Container className={classes.root} maxwidth="sm"> | 34 | <Container className={classes.root} maxwidth="sm"> |
| 33 | <Grid className={classes.item} container spacing={3}> | 35 | <Grid className={classes.item} container spacing={3}> |
| 34 | <Grid item xs="6" sm="6" md="3"> | 36 | <Grid item xs="6" sm="6" md="3"> |
| 35 | - <TodoCard data={data}/> | 37 | + <TodoCard data={data} /> |
| 36 | </Grid> | 38 | </Grid> |
| 37 | <Grid item xs="6" sm="6" md="3" alignItems="center"> | 39 | <Grid item xs="6" sm="6" md="3" alignItems="center"> |
| 38 | <Icon style={{ fontSize: 60 }}>add_circle</Icon> | 40 | <Icon style={{ fontSize: 60 }}>add_circle</Icon> | ... | ... |
| ... | @@ -14,38 +14,54 @@ const useStyles = makeStyles({ | ... | @@ -14,38 +14,54 @@ const useStyles = makeStyles({ |
| 14 | float: "left", | 14 | float: "left", |
| 15 | }, | 15 | }, |
| 16 | icon: { | 16 | icon: { |
| 17 | - marginRight: "1%", | 17 | + fontSize: 18, |
| 18 | + marginTop: "auto", | ||
| 18 | float: "right", | 19 | float: "right", |
| 19 | color: "black", | 20 | color: "black", |
| 20 | }, | 21 | }, |
| 21 | title: { | 22 | title: { |
| 22 | clear: "both", | 23 | clear: "both", |
| 24 | + float: "left", | ||
| 25 | + }, | ||
| 26 | + checkBox: { | ||
| 27 | + clear: "both", | ||
| 28 | + float: "left", | ||
| 23 | }, | 29 | }, |
| 24 | - pos: { | 30 | + |
| 25 | - marginBottom: 12, | 31 | + percent: { |
| 32 | + color: "#00BB00", | ||
| 33 | + float: "right", | ||
| 26 | }, | 34 | }, |
| 27 | }); | 35 | }); |
| 28 | 36 | ||
| 29 | export default function TodoCard(props) { | 37 | export default function TodoCard(props) { |
| 30 | const classes = useStyles(); | 38 | const classes = useStyles(); |
| 31 | - | 39 | + const data = props.data; |
| 32 | return ( | 40 | return ( |
| 33 | <Card className={classes.root}> | 41 | <Card className={classes.root}> |
| 34 | <CardContent> | 42 | <CardContent> |
| 35 | <Typography className={classes.date} color="textSecondary" gutterBottom> | 43 | <Typography className={classes.date} color="textSecondary" gutterBottom> |
| 36 | - {props.data.date} | 44 | + {data.date} · {data.name} · {data.isPublic} |
| 37 | </Typography> | 45 | </Typography> |
| 46 | + | ||
| 38 | <Icon className={classes.icon} color="primary"> | 47 | <Icon className={classes.icon} color="primary"> |
| 39 | settings | 48 | settings |
| 40 | </Icon> | 49 | </Icon> |
| 41 | - <Typography className={classes.title} variant="h5" component="h2"> | 50 | + |
| 42 | - {props.data.title} | 51 | + <Typography className={classes.title} variant="h6"> |
| 52 | + {data.title} | ||
| 43 | </Typography> | 53 | </Typography> |
| 44 | - {props.data.todo.map((todo) => { | 54 | + <Typography className={classes.percent} variant="h6"> |
| 55 | + 99% | ||
| 56 | + </Typography> | ||
| 57 | + | ||
| 58 | + {data.todo.map((todo) => { | ||
| 45 | return ( | 59 | return ( |
| 46 | - <div> | 60 | + <FormControlLabel |
| 47 | - <FormControlLabel control={<Checkbox />} label={todo} /> | 61 | + className={classes.checkBox} |
| 48 | - </div> | 62 | + control={<Checkbox />} |
| 63 | + label={todo} | ||
| 64 | + /> | ||
| 49 | ); | 65 | ); |
| 50 | })} | 66 | })} |
| 51 | </CardContent> | 67 | </CardContent> | ... | ... |
-
Please register or login to post a comment