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:34 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2c5528d579dd1d8350db00f9322c9e71ac856421
2c5528d5
1 parent
69243e01
rename "HomeDate" to HomeTodo
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
48 deletions
front/src/Components/Home/HomeDate.js
front/src/Components/Home/HomeDate.js
deleted
100644 → 0
View file @
69243e0
import
React
,
{
useState
,
useEffect
}
from
"react"
;
import
styled
from
"styled-components"
;
import
moment
from
"moment"
;
const
HomeDate
=
styled
.
div
`
display: flex;
flex-direction: column;
`
;
const
WeatherBox
=
styled
.
div
``
;
const
WeatherSpan
=
styled
.
span
``
;
const
DateBox
=
styled
.
div
`
display: flex;
flex-direction: column;
`
;
const
DateSpan
=
styled
.
span
`
font-size:
${(
props
)
=>
{
if
(
props
.
className
===
"Clock"
)
return
"45px"
;
}};
`;
export default () => {
const [date, setDate] = useState(moment().format("h:mm:ss a"));
useEffect(() => {
let timer = setInterval(() => tick(), 1000);
return function cleanUp() {
clearInterval(timer);
};
});
function tick() {
setDate(moment().format("h:mm:ss a"));
}
return (
<HomeDate>
<WeatherBox>
<WeatherSpan /> Weather
</WeatherBox>
<DateBox>
<DateSpan className="Clock">{date}</DateSpan>
</DateBox>
</HomeDate>
);
};
Please
register
or
login
to post a comment