-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathleaderboard-desktop.tsx
More file actions
82 lines (76 loc) · 2.25 KB
/
leaderboard-desktop.tsx
File metadata and controls
82 lines (76 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import { ClashData, ClashDataMap } from '@/types'
import Column from './column'
import { PurpleArrowLeft, PurpleArrowRight } from './icons'
export type LeaderboardProps = {
leaderboard: ClashDataMap[]
currentDay: number
}
export default function LeaderboardDesktop(props: LeaderboardProps) {
const { leaderboard, currentDay } = props
const renderDay = (
day: number,
from: number,
to: number,
color: string,
dayFourIndex?: number
) => {
return (
<>
<div
className="column-day justify-between-grid"
style={{ position: 'relative', backgroundColor: color, margin: 10 }}
>
<p className="day-title">Day {day}</p>
{leaderboard && leaderboard[day] && (
<Column
currentDay={currentDay}
dayFourIndex={dayFourIndex}
to={to}
from={from}
clashDataForDay={
// @ts-ignore
leaderboard[day] as any
}
day={day}
/>
)}
{day === 5 ? (
<div className="justify-between-grid">
<div className="pair">
<br></br>
<br></br>
<div className="channel-name-box">mfres</div>
</div>
</div>
) : null}
<div style={{ height: 300 }}></div>
<div style={{ position: 'absolute', bottom: 0 }}>
<img width="100%" src={`whale_day_${day}.jpg`}></img>
</div>
</div>
</>
)
}
console.log(leaderboard, 'leaderboard')
return (
<div className="body-desktop">
<div className="flex-direction-row">
{' '}
<PurpleArrowRight />{' '}
<b style={{ marginLeft: 15, marginRight: 15 }}> WINNER </b>
<PurpleArrowLeft />
</div>
<div className="flex-direction-row ">
{renderDay(1, 0, 4, '#FFE2E2')}
{renderDay(2, 0, 2, '#FCFCCB')}
{renderDay(3, 0, 1, '#D1FFD2')}
{renderDay(4, 1, 1, '#CBE1FF', 1)}
{renderDay(5, 0, 0, '#B8B2FF')}
{renderDay(4, 1, 1, '#CBE1FF', 2)}
{renderDay(3, 1, 2, '#D1FFD2')}
{renderDay(2, 2, 4, '#FCFCCB')}
{renderDay(1, 4, 8, '#FFE2E2')}
</div>
</div>
)
}