Toggle navigation
Toggle navigation
This project
Loading...
Sign in
김대휘
/
Do-gether
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
김대휘
2020-06-15 03:37:46 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
95988a161d9f44a06cd90063b75719b2e35148fb
95988a16
1 parent
936034e6
카드 정렬 및 날짜표시
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
18 deletions
client/src/components/BodyLayout.js
client/src/components/NavBar.js
client/src/components/TodoCard.js
client/src/components/BodyLayout.js
View file @
95988a1
...
...
@@ -3,15 +3,17 @@ import React, { useState, useEffect } from "react";
import
{
makeStyles
}
from
"@material-ui/core/styles"
;
import
Container
from
"@material-ui/core/Container"
;
import
Grid
from
"@material-ui/core/Grid"
;
import
Typography
from
"@material-ui/core/Typography"
;
import
Icon
from
"@material-ui/core/Icon"
;
import
CircularProgress
from
"@material-ui/core/CircularProgress"
;
//
import CircularProgress from "@material-ui/core/CircularProgress";
import
TodoCard
from
"./TodoCard.js"
;
const
useStyles
=
makeStyles
((
theme
)
=>
({
root
:
{
minHeight
:
"100vh"
,
backgroundColor
:
"rgba(
1,0,0,0.5)"
minHeight
:
"100vh"
,
backgroundColor
:
"rgba(
0,0,0,0.5)"
,
},
container
:
{
flexGrow
:
1
,
...
...
@@ -19,7 +21,7 @@ const useStyles = makeStyles((theme) => ({
paddingBottom
:
"1rem"
,
marginLeft
:
"auto"
,
marginRight
:
"auto"
,
}
}
,
}));
export
default
function
BodyLayout
()
{
...
...
@@ -31,7 +33,7 @@ export default function BodyLayout() {
const
callApi
=
async
()
=>
{
const
response
=
await
fetch
(
"/api/cards"
);
const
body
=
await
response
.
json
();
return
body
;
return
body
.
reverse
()
;
};
useEffect
(()
=>
{
...
...
@@ -44,27 +46,35 @@ export default function BodyLayout() {
},
[]);
if
(
isLoading
)
{
return
(
<>
<
CircularProgress
/>
<
/
>
);
return
<><
/>
;
}
else
{
return
(
<
div
className
=
{
classes
.
root
}
>
<
Container
className
=
{
classes
.
container
}
maxwidth
=
"md"
>
<
Grid
className
=
{
classes
.
item
}
container
>
{
data
.
map
((
data
)
=>
{
{
data
.
map
((
card
,
idx
)
=>
{
if
(
idx
===
0
||
card
.
date
!==
data
[
idx
-
1
].
date
)
{
return
(
<>
<
Typography
variant
=
"h4"
style
=
{{
width
:
"100%"
,
color
:
"white"
}}
>
{
card
.
date
}
<
/Typography
>
<
Grid
item
xs
=
{
6
}
sm
=
{
6
}
md
=
{
3
}
>
<
TodoCard
id
=
{
data
.
id
}
data
=
{
data
}
/
>
<
TodoCard
key
=
{
card
.
id
}
data
=
{
card
}
/
>
<
/Grid
>
<
/
>
);
})}
<
hr
width
=
"100%"
height
=
"19%"
color
=
"white"
/>
}
else
{
return
(
<
Grid
item
xs
=
{
6
}
sm
=
{
6
}
md
=
{
3
}
>
<
Icon
style
=
{{
fontSize
:
60
}}
>
add_circle
<
/Icon
>
<
TodoCard
key
=
{
card
.
id
}
data
=
{
card
}
/
>
<
/Grid
>
);
}
})}
{
/* <Grid item xs={6} sm={6} md={3}>
<Icon style={{ fontSize: 60 }}>add_circle</Icon>
</Grid> */
}
<
/Grid
>
<
/Container
>
<
/div
>
...
...
client/src/components/NavBar.js
View file @
95988a1
...
...
@@ -33,9 +33,9 @@ export default function ButtonAppBar() {
<
MenuIcon
/>
<
/IconButton
>
<
Typography
variant
=
"h6"
className
=
{
classes
.
title
}
>
Fuck
Do
-
gether
<
/Typography
>
<
Button
color
=
"inherit"
>
Log
in
<
/Button
>
<
Button
color
=
"inherit"
>
Log
out
<
/Button
>
<
/Toolbar
>
<
/AppBar
>
<
/div
>
...
...
client/src/components/TodoCard.js
View file @
95988a1
...
...
@@ -41,7 +41,7 @@ export default function TodoCard(props) {
const
todo
=
data
.
todo
.
split
(
","
);
const
isTrue
=
"1"
;
const
check
=
data
.
ck
.
split
(
","
).
map
((
ck
)
=>
{
return
isTrue
==
ck
;
return
isTrue
==
=
ck
;
});
return
(
...
...
Please
register
or
login
to post a comment