1
- import React from "react" ;
2
- import styled from "styled-components" ;
1
+ import React , { ReactNode } from "react" ;
3
2
4
- const TableContainer = styled . div `
5
- overflow-x: auto;
6
- margin: 20px;
7
- ` ;
3
+ interface HeaderCellProps {
4
+ children : ReactNode ;
5
+ }
6
+
7
+ const HeaderCell = ( { children } : HeaderCellProps ) => (
8
+ < th className = "py-2 px-3 bg-gray-100 font-semibold border border-gray-300 dark:bg-gray-700 dark:border-gray-600 whitespace-nowrap" >
9
+ { children }
10
+ </ th >
11
+ ) ;
8
12
9
- const Table = styled . table `
10
- width: 100%;
11
- border-collapse: collapse;
12
- text-align: left;
13
- font-size: 14px;
13
+ interface CellProps {
14
+ children : ReactNode ;
15
+ }
14
16
15
- @media (max-width: 768px) {
16
- font-size: 12px;
17
- }
18
- ` ;
17
+ const Cell = ( { children } : CellProps ) => (
18
+ < td className = "py-2 px-3 border border-gray-300 dark:border-gray-600 whitespace-nowrap" >
19
+ { children }
20
+ </ td >
21
+ ) ;
22
+
23
+ interface RowProps {
24
+ children : ReactNode ;
25
+ isEven : boolean ;
26
+ }
19
27
20
- const Header = styled . th `
21
- background-color: #f1f1f1;
22
- padding: 12px;
23
- font-weight: bold;
24
- border: 1px solid #ddd;
25
- white-space: nowrap;
26
- ` ;
28
+ const Row = ( { children, isEven } : RowProps ) => (
29
+ < tr
30
+ className = { `border-b ${
31
+ isEven ? "bg-gray-100 dark:bg-gray-700" : "dark:bg-gray-800"
32
+ } `}
33
+ >
34
+ { children }
35
+ </ tr >
36
+ ) ;
27
37
28
- const Row = styled . tr `
29
- &:nth-child(even) {
30
- background-color: #f9f9f9;
31
- }
32
- ` ;
38
+ interface SubtotalRowProps {
39
+ children : ReactNode ;
40
+ }
33
41
34
- const SubtotalRow = styled ( Row ) `
35
- background-color: #e6f2ff !important;
36
- font-weight: bold;
37
- ` ;
42
+ const SubtotalRow = ( { children } : SubtotalRowProps ) => (
43
+ < tr className = "bg-blue-100 font-semibold dark:bg-blue-900 dark:text-blue-300" >
44
+ { children }
45
+ </ tr >
46
+ ) ;
38
47
39
- const TotalRow = styled ( Row ) `
40
- background-color: #d9ead3;
41
- font-weight: bold;
42
- ` ;
48
+ interface TotalRowProps {
49
+ children : ReactNode ;
50
+ }
43
51
44
- const Cell = styled . td `
45
- padding: 12px;
46
- border: 1px solid #ddd;
47
- white-space: nowrap;
48
- ` ;
52
+ const TotalRow = ( { children } : TotalRowProps ) => (
53
+ < tr className = "bg-green-100 font-semibold dark:bg-green-900 dark:text-green-300" >
54
+ { children }
55
+ </ tr >
56
+ ) ;
49
57
50
58
export default function AllocationTable ( ) {
51
59
return (
52
- < TableContainer >
53
- < Table >
60
+ < div className = "overflow-x-auto m-5" >
61
+ < table className = "w-full border-collapse text-left text-sm text-gray-800 dark:text-gray-300" >
54
62
< thead >
55
- < Row >
56
- < Header > Allocation Category</ Header >
57
- < Header > Entity Name</ Header >
58
- < Header > Allocated Share (%)</ Header >
59
- < Header > Vesting Plan</ Header >
60
- < Header > Cliff (Months)</ Header >
61
- < Header > Vesting Period (Months)</ Header >
62
- < Header > Immediate Liquidity (%)</ Header >
63
- < Header > Initial Liquid Tokens</ Header >
64
- < Header > Cliff-Release Tokens</ Header >
65
- < Header > Monthly Vesting Rate</ Header >
66
- < Header > Total Tokens Allocated</ Header >
67
- </ Row >
63
+ < TotalRow >
64
+ < HeaderCell > Allocation Category</ HeaderCell >
65
+ < HeaderCell > Entity Name</ HeaderCell >
66
+ < HeaderCell > Allocated Share (%)</ HeaderCell >
67
+ < HeaderCell > Vesting Plan</ HeaderCell >
68
+ < HeaderCell > Cliff (Months)</ HeaderCell >
69
+ < HeaderCell > Vesting Period (Months)</ HeaderCell >
70
+ < HeaderCell > Immediate Liquidity (%)</ HeaderCell >
71
+ < HeaderCell > Initial Liquid Tokens</ HeaderCell >
72
+ < HeaderCell > Cliff-Release Tokens</ HeaderCell >
73
+ < HeaderCell > Monthly Vesting Rate</ HeaderCell >
74
+ < HeaderCell > Total Tokens Allocated</ HeaderCell >
75
+ </ TotalRow >
68
76
</ thead >
69
77
< tbody >
70
- < Row >
78
+ < Row isEven = { false } >
71
79
< Cell > Contributors</ Cell >
72
80
< Cell > Webb (Developer)</ Cell >
73
81
< Cell > 28.56500%</ Cell >
@@ -80,7 +88,7 @@ export default function AllocationTable() {
80
88
< Cell > 2,380,416.67</ Cell >
81
89
< Cell > 28,565,000.00</ Cell >
82
90
</ Row >
83
- < Row >
91
+ < Row isEven = { true } >
84
92
< Cell > Contributors</ Cell >
85
93
< Cell > Investors</ Cell >
86
94
< Cell > 13.64000%</ Cell >
@@ -93,7 +101,7 @@ export default function AllocationTable() {
93
101
< Cell > 1,136,666.67</ Cell >
94
102
< Cell > 13,640,000.00</ Cell >
95
103
</ Row >
96
- < Row >
104
+ < Row isEven = { false } >
97
105
< Cell > Contributors</ Cell >
98
106
< Cell > Indiv. Contributors</ Cell >
99
107
< Cell > 1.43500%</ Cell >
@@ -107,17 +115,17 @@ export default function AllocationTable() {
107
115
< Cell > 1,435,000.00</ Cell >
108
116
</ Row >
109
117
< SubtotalRow >
110
- < Cell colSpan = { 2 } >
118
+ < Cell col-Span = { 2 } >
111
119
< strong > Contributors Total</ strong >
112
120
</ Cell >
113
121
< Cell > 43.64000%</ Cell >
114
- < Cell colSpan = { 4 } > </ Cell >
122
+ < td colSpan = { 4 } > </ td >
115
123
< Cell > 0.00</ Cell >
116
124
< Cell > 21,820,000.00</ Cell >
117
- < Cell colSpan = { 1 } > </ Cell >
125
+ < td colSpan = { 1 } > </ td >
118
126
< Cell > 43,640,000.00</ Cell >
119
127
</ SubtotalRow >
120
- < Row >
128
+ < Row isEven = { true } >
121
129
< Cell > Governance-Managed</ Cell >
122
130
< Cell > On-chain Treasury</ Cell >
123
131
< Cell > 36.36000%</ Cell >
@@ -130,7 +138,7 @@ export default function AllocationTable() {
130
138
< Cell > n/a</ Cell >
131
139
< Cell > 36,360,000.00</ Cell >
132
140
</ Row >
133
- < Row >
141
+ < Row isEven = { false } >
134
142
< Cell > Governance-Managed</ Cell >
135
143
< Cell > Foundation</ Cell >
136
144
< Cell > 15.00000%</ Cell >
@@ -144,17 +152,17 @@ export default function AllocationTable() {
144
152
< Cell > 15,000,000.00</ Cell >
145
153
</ Row >
146
154
< SubtotalRow >
147
- < Cell colSpan = { 2 } >
155
+ < Cell col-Span = { 2 } >
148
156
< strong > Governance-Managed Total</ strong >
149
157
</ Cell >
150
158
< Cell > 51.36000%</ Cell >
151
- < Cell colSpan = { 4 } > </ Cell >
159
+ < td colSpan = { 4 } > </ td >
152
160
< Cell > 750,000.00</ Cell >
153
161
< Cell > 593,750.00</ Cell >
154
- < Cell colSpan = { 1 } > </ Cell >
162
+ < td colSpan = { 1 } > </ td >
155
163
< Cell > 51,360,000.00</ Cell >
156
164
</ SubtotalRow >
157
- < Row >
165
+ < Row isEven = { true } >
158
166
< Cell > Airdrop Pool</ Cell >
159
167
< Cell > Leaderboard Participants</ Cell >
160
168
< Cell > 2.00000%</ Cell >
@@ -167,7 +175,7 @@ export default function AllocationTable() {
167
175
< Cell > 82,608.70</ Cell >
168
176
< Cell > 2,000,000.00</ Cell >
169
177
</ Row >
170
- < Row >
178
+ < Row isEven = { false } >
171
179
< Cell > Airdrop Pool</ Cell >
172
180
< Cell > DOT Validators Snapshot</ Cell >
173
181
< Cell > 1.00000%</ Cell >
@@ -180,7 +188,7 @@ export default function AllocationTable() {
180
188
< Cell > 41,304.35</ Cell >
181
189
< Cell > 1,000,000.00</ Cell >
182
190
</ Row >
183
- < Row >
191
+ < Row isEven = { true } >
184
192
< Cell > Airdrop Pool</ Cell >
185
193
< Cell > EDG Genesis Participants</ Cell >
186
194
< Cell > 1.00000%</ Cell >
@@ -193,7 +201,7 @@ export default function AllocationTable() {
193
201
< Cell > 41,304.35</ Cell >
194
202
< Cell > 1,000,000.00</ Cell >
195
203
</ Row >
196
- < Row >
204
+ < Row isEven = { false } >
197
205
< Cell > Airdrop Pool</ Cell >
198
206
< Cell > EDG 2023 Snapshot</ Cell >
199
207
< Cell > 1.00000%</ Cell >
@@ -207,28 +215,28 @@ export default function AllocationTable() {
207
215
< Cell > 1,000,000.00</ Cell >
208
216
</ Row >
209
217
< SubtotalRow >
210
- < Cell colSpan = { 2 } >
218
+ < Cell col-Span = { 2 } >
211
219
< strong > Airdrop Pools Subtotal</ strong >
212
220
</ Cell >
213
221
< Cell > 5.00000%</ Cell >
214
- < Cell colSpan = { 4 } > </ Cell >
222
+ < td colSpan = { 4 } > </ td >
215
223
< Cell > 250,000.00</ Cell >
216
224
< Cell > 197,916.67</ Cell >
217
225
< Cell > 206,521.74</ Cell >
218
226
< Cell > 5,000,000.00</ Cell >
219
227
</ SubtotalRow >
220
228
< TotalRow >
221
- < Cell colSpan = { 2 } >
229
+ < Cell col-Span = { 2 } >
222
230
< strong > Total Supply</ strong >
223
231
</ Cell >
224
232
< Cell > 100.00000%</ Cell >
225
- < Cell colSpan = { 4 } > </ Cell >
233
+ < td colSpan = { 4 } > </ td >
226
234
< Cell > 1,000,000.00</ Cell >
227
- < Cell colSpan = { 2 } > </ Cell >
235
+ < td colSpan = { 2 } > </ td >
228
236
< Cell > 100,000,000.00</ Cell >
229
237
</ TotalRow >
230
238
</ tbody >
231
- </ Table >
232
- </ TableContainer >
239
+ </ table >
240
+ </ div >
233
241
) ;
234
242
}
0 commit comments