Skip to content

Commit a23c0b1

Browse files
committed
refactor: move countdown components from 2025-specific path to views and introduce StyledTimerNumber for styling.
1 parent df8ba62 commit a23c0b1

6 files changed

Lines changed: 25 additions & 126 deletions

File tree

src/2025/Home/components/Home/Home.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Countdown from "react-countdown";
22
import React, { FC } from "react";
33
import { SectionWrapper } from "@components/SectionWrapper/SectionWrapper";
44
import { BIGGER_BREAKPOINT } from "@constants/BreakPoints";
5-
import TimeCountDown from "./components/TimeCountdown";
5+
import TimeCountDown from "@views/Home/components/Home/components/TimeCountdown";
66
import { useWindowSize } from "react-use";
77
import { useDateInterval } from "@hooks/useDateInterval";
88
// @ts-expect-error some quirky import
@@ -27,7 +27,7 @@ import InfoButtons from "../InfoButtons/InfoButtons";
2727
import { formatDateRange } from "./DateUtil";
2828
import { Link } from "react-router";
2929
import edition from "@data/2025.json";
30-
import CountDownCompleted from "./components/CountDownCompleted";
30+
import CountDownCompleted from "@views/Home/components/Home/components/CountDownCompleted";
3131

3232
const Home: FC<React.PropsWithChildren<unknown>> = () => {
3333
const { width } = useWindowSize();

src/2025/Home/components/Home/components/CountDownCompleted.tsx

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

src/2025/Home/components/Home/components/TimeCountdown.tsx

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

src/2025/Home/components/Home/components/countdown.style.ts

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

src/views/Home/components/Home/components/TimeCountdown.tsx

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import React, {FC} from 'react';
1+
import React, { FC } from 'react';
22
import {
33
StyledTimerContainer,
4+
StyledTimerNumber,
45
StyledTimerLetters,
56
StyleLine,
67
TimeCountDownContainer
@@ -14,30 +15,30 @@ type TimeCountDownProps = {
1415
};
1516

1617
const TimeCountDown: FC<React.PropsWithChildren<TimeCountDownProps>> = ({
17-
days,
18-
hours,
19-
minutes,
20-
seconds,
21-
}) => {
18+
days,
19+
hours,
20+
minutes,
21+
seconds,
22+
}) => {
2223
return (
2324
<TimeCountDownContainer id="countdown-ongoing">
2425
<StyledTimerContainer>
25-
<p>{days}</p>
26+
<StyledTimerNumber>{days}</StyledTimerNumber>
2627
<StyledTimerLetters>DAYS</StyledTimerLetters>
2728
</StyledTimerContainer>
28-
<StyleLine/>
29+
<StyleLine />
2930
<StyledTimerContainer>
30-
<p>{hours}</p>
31+
<StyledTimerNumber>{hours}</StyledTimerNumber>
3132
<StyledTimerLetters>HOURS</StyledTimerLetters>
3233
</StyledTimerContainer>
33-
<StyleLine/>
34+
<StyleLine />
3435
<StyledTimerContainer>
35-
<p>{minutes}</p>
36+
<StyledTimerNumber>{minutes}</StyledTimerNumber>
3637
<StyledTimerLetters>MINUTES</StyledTimerLetters>
3738
</StyledTimerContainer>
38-
<StyleLine/>
39+
<StyleLine />
3940
<StyledTimerContainer>
40-
<p>{seconds}</p>
41+
<StyledTimerNumber>{seconds}</StyledTimerNumber>
4142
<StyledTimerLetters>SECONDS</StyledTimerLetters>
4243
</StyledTimerContainer>
4344
</TimeCountDownContainer>

src/views/Home/components/Home/components/countdown.style.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,16 @@ export const StyledTimerContainer = styled.div`
2020
height: 5rem;
2121
justify-content: center;
2222
width: 5rem;
23+
padding-top: 10px;
2324
`;
25+
26+
export const StyledTimerNumber = styled.p`
27+
color: white;
28+
margin-bottom:5px;
29+
`;
30+
31+
32+
2433
export const StyleLine = styled.div`
2534
width: 0.75rem;
2635
background: ${Color.DARK_BLUE};

0 commit comments

Comments
 (0)