Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-capstone-design1
/
Triz_Project1
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
sdy
2020-05-16 17:13:51 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ce75a6aba155d009870d9efe8e7275d369b7f2e4
ce75a6ab
1 parent
f4393ae5
update style
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
0 deletions
front/src/Components/Home/HomeTodo.js
front/src/Components/Home/HomeTodo.js
0 → 100644
View file @
ce75a6a
import
React
,
{
useState
,
useEffect
}
from
"react"
;
import
styled
from
"styled-components"
;
import
moment
from
"moment"
;
import
Input
from
"../Input"
;
const
HomeTodo
=
styled
.
div
`
display: flex;
flex-direction: column;
`
;
const
DateBox
=
styled
.
div
`
display: flex;
flex-direction: column;
input {
margin-top: 20px;
background: none;
border-bottom: 1px solid;
border-radius: 0px;
border-color: white;
}
`
;
const
DateSpan
=
styled
.
span
`
font-size:
${(
props
)
=>
{
if
(
props
.
className
===
"Clock"
)
return
"85px"
;
if
(
props
.
className
===
"Title"
)
return
"30px"
;
}};
color
:
white
;
text
-
align
:
center
;
&
:
not
(:
last
-
child
)
{
margin
-
bottom
:
20
px
;
}
`;
export default () => {
const [date, setDate] = useState(moment().format("h:mm:ss"));
useEffect(() => {
let timer = setInterval(() => tick(), 1000);
return function cleanUp() {
clearInterval(timer);
};
});
function tick() {
setDate(moment().format("h:mm:ss"));
}
return (
<HomeTodo>
<DateBox>
<DateSpan className="Clock">{date}</DateSpan>
<DateSpan className="Title">Enter Todo list</DateSpan>
<Input placeholder={""} />
</DateBox>
</HomeTodo>
);
};
Please
register
or
login
to post a comment