Skip to content

Commit e93690b

Browse files
committed
feat: add pages
1 parent e51dbe8 commit e93690b

6 files changed

Lines changed: 55 additions & 35 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import styled from '@emotion/styled'
2+
import { Box, Icon, Link } from '@sthack/scoreboard-ui/components'
3+
import { SizeProps } from 'styled-system'
4+
5+
export type EditionLinkProps = {
6+
year: number
7+
logo: Icon
8+
}
9+
10+
export function EditionLink({
11+
year,
12+
logo: Icon,
13+
size = '13',
14+
}: EditionLinkProps & SizeProps) {
15+
return (
16+
<SLink to={`/year/${year}`} flexDirection="column">
17+
<Icon size={size} />
18+
<Box as="span">{`${year}`}</Box>
19+
</SLink>
20+
)
21+
}
22+
23+
const SLink = styled(Link)`
24+
svg {
25+
filter: drop-shadow(-1px 6px 3px hsl(0deg 0% 0% / 80%));
26+
}
27+
`

hall-of-fame/src/components/Footer.tsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@ import {
22
Box,
33
IconAchievement,
44
IconChallenge,
5+
IconLogo2023,
6+
IconLogo2024,
7+
IconLogo2025,
58
Link,
69
} from '@sthack/scoreboard-ui/components'
10+
import { EditionLink } from './EditionLink'
711

812
export function Footer() {
913
return (
@@ -26,15 +30,9 @@ export function Footer() {
2630
overflowX="auto"
2731
px="1"
2832
>
29-
<Link to="/rules">
30-
<IconChallenge color="currentColor" size="1.5em" />
31-
Rules
32-
</Link>
33-
34-
<Link to="/scoreboard">
35-
<IconAchievement color="currentColor" size="1.5em" />
36-
Scoreboard
37-
</Link>
33+
<EditionLink size={2} year={2025} logo={IconLogo2025} />
34+
<EditionLink size={2} year={2024} logo={IconLogo2024} />
35+
<EditionLink size={2} year={2023} logo={IconLogo2023} />
3836
</Box>
3937
</Box>
4038
)

hall-of-fame/src/components/Header.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
import styled from '@emotion/styled'
2-
import { Box, Logo } from '@sthack/scoreboard-ui/components'
2+
import {
3+
Box,
4+
IconLogo2023,
5+
IconLogo2024,
6+
IconLogo2025,
7+
Logo,
8+
} from '@sthack/scoreboard-ui/components'
39
import { NavLink } from 'react-router-dom'
410
import { space, SpaceProps } from 'styled-system'
11+
import { EditionLink } from './EditionLink'
512

613
export function Header() {
714
return (
@@ -22,8 +29,9 @@ export function Header() {
2229

2330
<nav>
2431
<Box display="flex" flexDirection="row" alignItems="center" as="ul">
25-
{/* <GameLink to="/scoreboard" label="Scoreboard" />
26-
<GameLink to="/rules" label="Rules" /> */}
32+
<EditionLink size={2} year={2025} logo={IconLogo2025} />
33+
<EditionLink size={2} year={2024} logo={IconLogo2024} />
34+
<EditionLink size={2} year={2023} logo={IconLogo2023} />
2735
</Box>
2836
</nav>
2937
</Box>

hall-of-fame/src/pages/Challenges.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ export function Challenges() {
5757
return computeGameScore(a, rewards, challenges, teams, config)
5858
}, [achievements, challenges, rewards, users])
5959

60+
if (yearNumber <= 2023) {
61+
return <BoxPanel title="Data not available" />
62+
}
63+
6064
return (
6165
<ConditionalLoader
6266
showLoader={loading}

hall-of-fame/src/pages/Home.tsx

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
import styled from '@emotion/styled'
21
import {
32
Box,
43
BoxPanel,
5-
Icon,
64
IconLogo2023,
75
IconLogo2024,
86
IconLogo2025,
9-
Link,
107
} from '@sthack/scoreboard-ui/components'
8+
import { EditionLink } from 'components/EditionLink'
119

1210
export function Home() {
1311
return (
@@ -63,23 +61,3 @@ export function Home() {
6361
</Box>
6462
)
6563
}
66-
67-
type EditionLinkProps = {
68-
year: number
69-
logo: Icon
70-
}
71-
72-
export function EditionLink({ year, logo: Icon }: EditionLinkProps) {
73-
return (
74-
<SLink to={`/year/${year}`} flexDirection="column">
75-
<Icon size="13" />
76-
<Box as="span">{`${year}`}</Box>
77-
</SLink>
78-
)
79-
}
80-
81-
const SLink = styled(Link)`
82-
svg {
83-
filter: drop-shadow(-1px 6px 3px hsl(0deg 0% 0% / 80%));
84-
}
85-
`

hall-of-fame/src/pages/Teams.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
GameScore,
66
} from '@sthack/scoreboard-common'
77
import {
8+
Box,
89
BoxPanel,
910
ConditionalLoader,
1011
IconTeams,
@@ -57,6 +58,10 @@ export function Teams() {
5758
return computeGameScore(a, rewards, challenges, teams, config)
5859
}, [achievements, challenges, rewards, users])
5960

61+
if (yearNumber <= 2023) {
62+
return <BoxPanel title="Data not available" />
63+
}
64+
6065
return (
6166
<ConditionalLoader
6267
showLoader={loading}

0 commit comments

Comments
 (0)