1
+ import { BaseHTMLAttributes } from "react"
1
2
import { useRouter } from "next/router"
2
3
import { GetStaticProps } from "next/types"
3
4
import { useTranslation } from "next-i18next"
4
5
import { serverSideTranslations } from "next-i18next/serverSideTranslations"
5
- import {
6
- Box ,
7
- BoxProps ,
8
- Flex ,
9
- HeadingProps ,
10
- List ,
11
- ListItem ,
12
- useColorModeValue ,
13
- } from "@chakra-ui/react"
14
6
15
7
import { BasePageProps , Lang } from "@/lib/types"
16
8
17
9
import ActionCard from "@/components/ActionCard"
18
10
import Breadcrumbs from "@/components/Breadcrumbs"
19
11
import FeedbackCard from "@/components/FeedbackCard"
20
- import { Image } from "@/components/Image"
21
- import InlineLink from "@/components/Link"
12
+ import { TwImage } from "@/components/Image"
22
13
import MainArticle from "@/components/MainArticle"
23
- import OldHeading from "@/components/OldHeading"
24
- import Text from "@/components/OldText"
25
14
import PageMetadata from "@/components/PageMetadata"
26
15
import TranslationLeaderboard from "@/components/TranslationLeaderboard"
16
+ import { Flex } from "@/components/ui/flex"
17
+ import InlineLink from "@/components/ui/Link"
18
+ import { ListItem , OrderedList } from "@/components/ui/list"
27
19
20
+ import { cn } from "@/lib/utils/cn"
28
21
import { existsNamespace } from "@/lib/utils/existsNamespace"
29
22
import { getLastDeployDate } from "@/lib/utils/getLastDeployDate"
30
23
import { getLocaleTimestamp } from "@/lib/utils/time"
@@ -34,17 +27,31 @@ import allTimeData from "../../../data/translation-reports/alltime/alltime-data.
34
27
import monthData from "../../../data/translation-reports/month/month-data.json"
35
28
import quarterData from "../../../data/translation-reports/quarter/quarter-data.json"
36
29
30
+ import useColorModeValue from "@/hooks/useColorModeValue"
37
31
import darkThemeCertificateImg from "@/public/images/certificates/dark-certificate.png"
38
32
import lightThemeCertificateImg from "@/public/images/certificates/light-certificate.png"
39
33
import dogeComputerImg from "@/public/images/doge-computer.png"
40
34
import whatIsEthereumImg from "@/public/images/what-is-ethereum.png"
41
35
42
- const Content = ( props : BoxProps ) => (
43
- < Box as = { MainArticle } py = { 4 } px = { 10 } w = "full" { ...props } />
36
+ const Content = ( {
37
+ className,
38
+ ...props
39
+ } : BaseHTMLAttributes < HTMLHeadingElement > ) => (
40
+ < MainArticle className = { cn ( "w-full px-10 py-4" , className ) } { ...props } />
44
41
)
45
42
46
- const ContentHeading = ( props : HeadingProps ) => (
47
- < OldHeading lineHeight = { 1.4 } { ...props } />
43
+ const H2 = ( {
44
+ className,
45
+ ...props
46
+ } : BaseHTMLAttributes < HTMLHeadingElement > ) => (
47
+ < h2 className = { cn ( "mb-8 mt-12 leading-xs" , className ) } { ...props } />
48
+ )
49
+
50
+ const Text = ( {
51
+ className,
52
+ ...props
53
+ } : BaseHTMLAttributes < HTMLHeadingElement > ) => (
54
+ < p className = { cn ( "mb-6" , className ) } { ...props } />
48
55
)
49
56
50
57
export const getStaticProps = ( async ( { locale } ) => {
@@ -81,7 +88,7 @@ const TranslatorAcknowledgements = () => {
81
88
)
82
89
83
90
return (
84
- < Flex direction = "column" align = "center" w = " full">
91
+ < Flex className = "w- full flex-col items-center ">
85
92
< PageMetadata
86
93
title = { t (
87
94
"page-contributing-translation-program-acknowledgements-meta-title"
@@ -93,26 +100,14 @@ const TranslatorAcknowledgements = () => {
93
100
94
101
< Content >
95
102
< Breadcrumbs slug = { router . asPath } className = "mt-12" />
96
- < ContentHeading
97
- as = "h1"
98
- fontSize = { { base : "2rem" , sm : "2.5rem" , md : "5xl" } }
99
- >
103
+ < h1 className = "my-8 leading-xs" >
100
104
{ t (
101
105
"page-contributing-translation-program-acknowledgements-acknowledgement-page-title"
102
106
) }
103
- </ ContentHeading >
104
- < Flex
105
- direction = { { base : "column" , lg : "row" } }
106
- align = { { base : "flex-start" , lg : "normal" } }
107
- w = "full"
108
- ms = { 0 }
109
- me = { { base : 0 , lg : 8 } }
110
- >
107
+ </ h1 >
108
+ < Flex className = "me-0 ms-0 w-full flex-col items-start lg:me-8 lg:flex-row" >
111
109
{ /* LEFT COLUMN */ }
112
- < Box
113
- m = { { base : "auto 0" , lg : "0 2rem 0 0" } }
114
- w = { { base : "full" , lg : "50%" } }
115
- >
110
+ < div className = "m-auto w-full lg:mb-0 lg:ml-0 lg:mr-8 lg:mt-0 lg:w-1/2" >
116
111
< Text >
117
112
{ t (
118
113
"page-contributing-translation-program-acknowledgements-acknowledgement-page-1"
@@ -143,34 +138,26 @@ const TranslatorAcknowledgements = () => {
143
138
{ /* <p>
144
139
<Translation id="page-contributing-translation-program-acknowledgements-acknowledgement-page-5" />
145
140
</p> */ }
146
- </ Box >
141
+ </ div >
147
142
{ /* RIGHT COLUMN */ }
148
- < Box
149
- m = { { base : "auto 0" , lg : "0 0 0 2rem" } }
150
- w = { { base : "full" , lg : "50%" } }
151
- >
152
- < Image
143
+ < div className = "m-auto w-full lg:mb-0 lg:ml-8 lg:mr-0 lg:mt-0 lg:w-1/2" >
144
+ < TwImage
145
+ width = { 500 }
153
146
src = { dogeComputerImg }
154
- w = { 500 }
155
147
alt = { t (
156
148
"page-contributing-translation-program-acknowledgements-hero-image-alt"
157
149
) }
158
150
/>
159
- </ Box >
151
+ </ div >
160
152
</ Flex >
161
153
</ Content >
162
154
163
- < Content maxW = "800px" >
164
- < ContentHeading
165
- as = "h2"
166
- textAlign = "center"
167
- fontSize = { { base : "2xl" , md : "2rem" } }
168
- fontWeight = { 600 }
169
- >
155
+ < Content className = "max-w-[800px]" >
156
+ < H2 className = "text-center" >
170
157
{ t (
171
158
"page-contributing-translation-program-acknowledgements-translation-leaderboard-title"
172
159
) }
173
- </ ContentHeading >
160
+ </ H2 >
174
161
< TranslationLeaderboard
175
162
monthData = { monthData }
176
163
quarterData = { quarterData }
@@ -184,15 +171,11 @@ const TranslatorAcknowledgements = () => {
184
171
</ Content >
185
172
186
173
< Content >
187
- < ContentHeading
188
- as = "h2"
189
- fontSize = { { base : "2xl" , md : "2rem" } }
190
- fontWeight = { 600 }
191
- >
174
+ < H2 >
192
175
{ t (
193
176
"page-contributing-translation-program-acknowledgements-our-translators-title"
194
177
) }
195
- </ ContentHeading >
178
+ </ H2 >
196
179
< Text >
197
180
{ t (
198
181
"page-contributing-translation-program-acknowledgements-our-translators-1"
@@ -213,15 +196,11 @@ const TranslatorAcknowledgements = () => {
213
196
</ Content >
214
197
215
198
< Content id = "certificate" >
216
- < ContentHeading
217
- as = "h2"
218
- fontSize = { { base : "2xl" , md : "2rem" } }
219
- fontWeight = { 600 }
220
- >
199
+ < H2 >
221
200
{ t (
222
201
"page-contributing-translation-program-acknowledgements-cert-title"
223
202
) }
224
- </ ContentHeading >
203
+ </ H2 >
225
204
< Text >
226
205
{ t ( "page-contributing-translation-program-acknowledgements-cert-1" ) }
227
206
</ Text >
@@ -231,21 +210,17 @@ const TranslatorAcknowledgements = () => {
231
210
< Text >
232
211
{ t ( "page-contributing-translation-program-acknowledgements-cert-3" ) }
233
212
</ Text >
234
- < Flex justify = " center">
235
- < Image src = { themedCertificateImage } alt = "translator certificate" />
213
+ < Flex className = "justify- center">
214
+ < TwImage src = { themedCertificateImage } alt = "translator certificate" />
236
215
</ Flex >
237
216
</ Content >
238
217
239
218
< Content id = "oats" >
240
- < ContentHeading
241
- as = "h2"
242
- fontSize = { { base : "2xl" , md : "2rem" } }
243
- fontWeight = { 600 }
244
- >
219
+ < H2 >
245
220
{ t (
246
221
"page-contributing-translation-program-acknowledgements-oats-title"
247
222
) }
248
- </ ContentHeading >
223
+ </ H2 >
249
224
< Text >
250
225
{ t ( "page-contributing-translation-program-acknowledgements-1" ) }
251
226
</ Text >
@@ -255,17 +230,13 @@ const TranslatorAcknowledgements = () => {
255
230
< Text >
256
231
{ t ( "page-contributing-translation-program-acknowledgements-3" ) }
257
232
</ Text >
258
- < ContentHeading
259
- as = "h3"
260
- fontSize = { { base : "xl" , md : "2xl" } }
261
- fontWeight = { 600 }
262
- >
233
+ < h3 className = "mb-8 mt-10 leading-xs" >
263
234
{ t (
264
235
"page-contributing-translation-program-acknowledgements-how-to-claim-title"
265
236
) }
266
- </ ContentHeading >
237
+ </ h3 >
267
238
268
- < List as = "ol" styleType = "decimal" >
239
+ < OrderedList >
269
240
< ListItem >
270
241
{ t (
271
242
"page-contributing-translation-program-acknowledgements-how-to-claim-1"
@@ -291,7 +262,7 @@ const TranslatorAcknowledgements = () => {
291
262
"page-contributing-translation-program-acknowledgements-how-to-claim-4"
292
263
) }
293
264
</ ListItem >
294
- </ List >
265
+ </ OrderedList >
295
266
< Text >
296
267
{ t ( "page-contributing-translation-program-acknowledgements-4" ) }
297
268
</ Text >
0 commit comments