Skip to content

Commit 314175f

Browse files
committed
Refactor: Refactoring Record page and it's components
1 parent b979954 commit 314175f

31 files changed

+367
-368
lines changed

components/Layouts/Header/RemixableHeader.style.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

components/Layouts/Header/RemixableHeader.tsx

Lines changed: 0 additions & 16 deletions
This file was deleted.

components/Menu/MobileMenu/MobileMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export default function MobileMenu() {
7070
{menuContent === "main" ? (
7171
<div className="footer">
7272
<span>
73-
Copyright &copy; 2022 Sanghyeok Park.
73+
Copyright &copy; {new Date().getFullYear()} Sanghyeok Park.
7474
<br />
7575
All rights reserved.
7676
</span>

components/TimerOption/AlarmSwitch/AlarmSwitch.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export default function AlarmSwitch() {
4545
language === "kor" ? "종료시 알람 소리 켜기" : "Activate alarm sound"
4646
}
4747
isActive={isAlarmSoundOn}
48-
isLoading={soundEffectAudio !== null}
48+
isLoading={soundEffectAudio === null}
4949
onSwitchOn={onSoundAlarmOn}
5050
onSwitchOff={onSoundAlarmOff}
5151
/>

components/Layouts/Footer/Footer.style.ts renamed to components/pages/index/Footer/Footer.style.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import styled from "@emotion/styled";
2+
import { Theme } from "../../../../styles/theme";
23

34
export const PauseButton = styled.button<{ triggerHide: boolean }>`
45
all: unset;
@@ -101,8 +102,7 @@ export const Container = styled.footer<{
101102
justify-content: center;
102103
align-items: flex-end;
103104
104-
@media screen and (max-width: ${({ theme }) =>
105-
theme.responsiveSizes.hideTimer}px) {
105+
@media screen and (max-width: ${Theme.responsiveSizes.hideTimer}px) {
106106
font-size: 15px;
107107
transition: transform
108108
${(props) =>

components/Layouts/Footer/Footer.tsx renamed to components/pages/index/Footer/Footer.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useEffect, useState } from "react";
22
import { useRecoilState, useRecoilValue } from "recoil";
3-
import useBottomSheet from "../../../hooks/useBottomSheet";
4-
import useMediaMatch from "../../../hooks/useMediaMatch";
3+
import useBottomSheet from "../../../../hooks/useBottomSheet";
4+
import useMediaMatch from "../../../../hooks/useMediaMatch";
55
import {
66
clockDegreeAtom as CD,
77
clockSizeAtom as CS,
@@ -10,14 +10,14 @@ import {
1010
languageOptionValueAtom as LOV,
1111
progressUnitValueAtom as PUV,
1212
maxClockTimeAtom as MCT,
13-
} from "../../../shared/atom";
14-
import { Theme } from "../../../styles/theme";
15-
import BottomSheetTimer from "../../BottomSheet/contents/BottomSheetTimer/BottomSheetTimer";
16-
import RoundButton from "../../Button/RoundButton/RoundButton";
13+
} from "../../../../shared/atom";
14+
import { Theme } from "../../../../styles/theme";
15+
import BottomSheetTimer from "../../../BottomSheet/contents/BottomSheetTimer/BottomSheetTimer";
16+
import RoundButton from "../../../Button/RoundButton/RoundButton";
1717
import {
1818
getPercentageFromDegree,
1919
getTimeFromDegree,
20-
} from "../../Timer/Timer.util";
20+
} from "../../../Timer/Timer.util";
2121
import { Container, PauseButton, TimeText } from "./Footer.style";
2222
import { IoMdPause } from "react-icons/io";
2323

@@ -66,7 +66,8 @@ export default function Footer() {
6666
/>
6767
) : (
6868
<span>
69-
Copyright &copy; 2022 Sanghyeok Park. All rights reserved.
69+
Copyright &copy; {new Date().getFullYear()} Sanghyeok Park. All
70+
rights reserved.
7071
</span>
7172
)
7273
) : null}

components/Layouts/Header/Header.style.ts renamed to components/pages/index/Header/Header.style.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { css } from "@emotion/react";
22
import styled from "@emotion/styled";
3-
import { Theme } from "../../../styles/theme";
3+
import { Theme } from "../../../../styles/theme";
44

55
export const IconContainer = styled.div`
66
display: inline-flex;
@@ -123,12 +123,10 @@ export const Container = styled.header<{
123123
? "0.5s cubic-bezier(0.2, 0, 0, 1) 0.4s"
124124
: "0.3s cubic-bezier(0, 0, 0, 1) 0.4s"};
125125
126-
@media screen and (max-width: ${({ theme }) =>
127-
theme.responsiveSizes.hideTimer}px) {
128-
transition: transform
129-
${(props) =>
130-
props.triggerHide
131-
? "0.5s cubic-bezier(0.2, 0, 0, 1) 0.1s"
132-
: "0.3s cubic-bezier(0, 0, 0, 1) 0.5s"};
126+
@media screen and (max-width: ${Theme.responsiveSizes.hideTimer}px) {
127+
transition: ${(props) =>
128+
props.triggerHide
129+
? "0.5s cubic-bezier(0.2, 0, 0, 1) 0.1s"
130+
: "0.3s cubic-bezier(0, 0, 0, 1) 0.5s"};
133131
}
134132
`;

components/Layouts/Header/Header.tsx renamed to components/pages/index/Header/Header.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ import {
77
isActiveMenuAtom as IAM,
88
progressUnitValueAtom as PUV,
99
maxClockTimeAtom as MCT,
10-
} from "../../../shared/atom";
10+
} from "../../../../shared/atom";
1111
import { Container, IconContainer, TimeText } from "./Header.style";
12-
import useMediaMatch from "../../../hooks/useMediaMatch";
13-
import { Theme } from "../../../styles/theme";
12+
import useMediaMatch from "../../../../hooks/useMediaMatch";
13+
import { Theme } from "../../../../styles/theme";
1414
import { useEffect, useState } from "react";
1515
import {
1616
getPercentageFromDegree,
1717
getTimeFromDegree,
18-
} from "../../Timer/Timer.util";
18+
} from "../../../Timer/Timer.util";
1919
import { IoMdMenu } from "react-icons/io";
2020

2121
export default function Header() {
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import styled from "@emotion/styled";
2+
3+
export const Container = styled.footer`
4+
width: 99%;
5+
height: 240px;
6+
7+
border-top: 2px solid ${({ theme }) => theme.background.secondary};
8+
9+
display: flex;
10+
flex-direction: column;
11+
justify-content: center;
12+
align-items: center;
13+
gap: 12px;
14+
15+
.copyright {
16+
font-size: 12px;
17+
color: #a0a0a0;
18+
}
19+
20+
.links {
21+
margin-top: 12px;
22+
display: flex;
23+
gap: 16px;
24+
25+
a {
26+
display: flex;
27+
gap: 4px;
28+
align-items: center;
29+
30+
color: #a0a0a0;
31+
text-decoration: none;
32+
33+
&:hover {
34+
text-decoration: underline;
35+
}
36+
}
37+
}
38+
39+
@media screen and (min-width: 768px) {
40+
height: 360px;
41+
}
42+
`;
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { MdOpenInNew } from "react-icons/md";
2+
import { Logo } from "../../../Intro/Intro.styled";
3+
import { Container } from "./Footer.styled";
4+
5+
export default function Footer() {
6+
return (
7+
<Container>
8+
<Logo
9+
size={14}
10+
hide={false}
11+
style={{ filter: "brightness(0.94)", flexDirection: "row" }}
12+
>
13+
<div className="word">Time</div>
14+
<div className="word bottom">Timer</div>
15+
</Logo>
16+
<span className="copyright">
17+
Copyright &copy; {new Date().getFullYear()} Sanghyeok Park. All rights
18+
reserved.
19+
</span>
20+
<div className="links">
21+
<a
22+
href="https://github.com/fecapark/time-timer"
23+
target="_blank"
24+
rel="noopener noreferrer"
25+
>
26+
<span>Github</span>
27+
<MdOpenInNew />
28+
</a>
29+
<a
30+
href="https://www.timetimer.com"
31+
target="_blank"
32+
rel="noopener noreferrer"
33+
>
34+
<span>About Time Timer</span>
35+
<MdOpenInNew />
36+
</a>
37+
</div>
38+
</Container>
39+
);
40+
}

0 commit comments

Comments
 (0)