-
Notifications
You must be signed in to change notification settings - Fork 627
Expand file tree
/
Copy paththemes.tsx
More file actions
55 lines (53 loc) · 1.71 KB
/
themes.tsx
File metadata and controls
55 lines (53 loc) · 1.71 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
import { THEMES_DATA } from '@/constants/themes';
import { useThemeContext } from '@/hooks/useThemes';
export function Themes() {
const { updateTheme } = useThemeContext();
return (
<div className="flex-1 bg-bgAuxiliary1 py-12 px-10">
<div className="grid grid-cols-1 gap-8">
{THEMES_DATA.map((theme) => {
return (
<div
key={theme.id}
className="p-4 flex items-start justify-between cursor-pointer"
style={{ backgroundColor: theme.background }}
onClick={() => {
updateTheme(theme.name);
}}
>
<div>
<h2 className="text-lg capitalize">{theme.name}</h2>
</div>
<div className="grid grid-cols-2">
<img
src="/bk.png"
className="w-16 h-16"
alt="chess-piece"
style={{ backgroundColor: theme['board-dark'] }}
/>
<img
src="/wn.png"
className="w-16 h-16"
alt="chess-piece"
style={{ backgroundColor: theme['board-light'] }}
/>
<img
src="/br.png"
className="w-16 h-16"
alt="chess-piece"
style={{ backgroundColor: theme['board-light'] }}
/>
<img
src="/wp.png"
className="w-16 h-16"
alt="chess-piece"
style={{ backgroundColor: theme['board-dark'] }}
/>
</div>
</div>
);
})}
</div>
</div>
);
}