1
+ import { HTMLAttributes } from "react"
1
2
import { GetStaticProps , InferGetStaticPropsType } from "next"
2
3
import { useTranslation } from "next-i18next"
3
4
import { serverSideTranslations } from "next-i18next/serverSideTranslations"
4
- import {
5
- Box ,
6
- Flex ,
7
- ListItem ,
8
- SimpleGrid ,
9
- UnorderedList ,
10
- } from "@chakra-ui/react"
11
5
12
6
import { BasePageProps , ChildOnlyProp , Lang } from "@/lib/types"
13
7
import { Framework } from "@/lib/interfaces"
14
8
15
9
import FeedbackCard from "@/components/FeedbackCard"
16
- import { Image } from "@/components/Image"
10
+ import Heading from "@/components/Heading"
11
+ import { TwImage } from "@/components/Image"
17
12
import MainArticle from "@/components/MainArticle"
18
- import Heading from "@/components/OldHeading"
19
- import Text from "@/components/OldText"
20
13
import PageMetadata from "@/components/PageMetadata"
21
14
import ProductCard from "@/components/ProductCard"
22
15
import Translation from "@/components/Translation"
16
+ import { Flex , VStack } from "@/components/ui/flex"
17
+ import { ListItem , UnorderedList } from "@/components/ui/list"
23
18
19
+ import { cn } from "@/lib/utils/cn"
24
20
import { dataLoader } from "@/lib/utils/data/dataLoader"
25
21
import { existsNamespace } from "@/lib/utils/existsNamespace"
26
22
import { getLastDeployDate } from "@/lib/utils/getLastDeployDate"
@@ -31,28 +27,21 @@ import { getLocalEnvironmentFrameworkData } from "@/lib/api/ghRepoData"
31
27
import EthBlocksImage from "@/public/images/developers-eth-blocks.png"
32
28
33
29
const Content = ( { children } : ChildOnlyProp ) => {
34
- return (
35
- < Box as = { MainArticle } py = { 4 } px = { 8 } w = "full" >
36
- { children }
37
- </ Box >
38
- )
30
+ return < MainArticle className = "w-full px-8 py-4" > { children } </ MainArticle >
39
31
}
40
32
41
33
const Column = ( { children } : ChildOnlyProp ) => {
42
34
return (
43
- < Box
44
- flex = "1 0 33%"
45
- justifyContent = "flex-end"
46
- mb = { 6 }
47
- me = { 8 }
48
- w = "full"
49
- maxW = { { base : "full" , md : "none" } }
50
- >
35
+ < div className = "mb-6 me-8 w-full max-w-full flex-shrink-0 flex-grow basis-1/3 justify-end md:max-w-none" >
51
36
{ children }
52
- </ Box >
37
+ </ div >
53
38
)
54
39
}
55
40
41
+ const Text = ( { className, ...props } : HTMLAttributes < HTMLHeadingElement > ) => (
42
+ < p className = { cn ( "mb-6" , className ) } { ...props } />
43
+ )
44
+
56
45
const loadData = dataLoader ( [
57
46
[ "frameworksListData" , getLocalEnvironmentFrameworkData ] ,
58
47
] )
@@ -92,19 +81,12 @@ const LocalEnvironmentPage = ({
92
81
const { t } = useTranslation ( "page-developers-local-environment" )
93
82
94
83
return (
95
- < Flex direction = "column" alignItems = "center" w = "full" mx = " auto" mt = { 16 } >
84
+ < VStack className = "mx- auto mt-16 w-full" >
96
85
< PageMetadata
97
86
title = { t ( "page-local-environment-setup-meta-title" ) }
98
87
description = { t ( "page-local-environment-setup-meta-desc" ) }
99
88
/>
100
- < Box
101
- pt = { { base : 0 , xl : 4 } }
102
- pb = { { base : 8 , xl : 4 } }
103
- px = { 8 }
104
- w = "full"
105
- mb = { 8 }
106
- justifyContent = "center"
107
- >
89
+ < div className = "mb-8 w-full justify-center px-8 pb-8 pt-0 xl:pb-4 xl:pt-4" >
108
90
< Heading
109
91
as = "h1"
110
92
fontStyle = "normal"
@@ -119,25 +101,14 @@ const LocalEnvironmentPage = ({
119
101
>
120
102
< Translation id = "page-developers-local-environment:page-local-environment-setup-title" />
121
103
</ Heading >
122
- < Text
123
- fontSize = "xl"
124
- lineHeight = { 1.4 }
125
- color = "text200"
126
- mb = { 2 }
127
- textAlign = "center"
128
- >
104
+ < Text className = "mb-2 text-center leading-xs text-body-medium" >
129
105
< Translation id = "page-developers-local-environment:page-local-environment-setup-subtitle" />
130
106
< br />
131
107
< Translation id = "page-developers-local-environment:page-local-environment-setup-subtitle-2" />
132
108
</ Text >
133
- </ Box >
109
+ </ div >
134
110
< Content >
135
- < Flex
136
- direction = { { base : "column-reverse" , lg : "row" } }
137
- alignItems = { { base : "flex-start" , lg : "center" } }
138
- w = "full"
139
- justifyContent = "space-between"
140
- >
111
+ < Flex className = "w-full flex-col-reverse items-start justify-between lg:flex-row lg:items-center" >
141
112
< Column >
142
113
< Heading
143
114
fontSize = { { base : "2xl" , md : "2rem" } }
@@ -172,17 +143,15 @@ const LocalEnvironmentPage = ({
172
143
</ UnorderedList >
173
144
</ Column >
174
145
< Column >
175
- < Image
176
- flex = "1 1 100%"
177
- backgroundSize = "cover"
178
- backgroundRepeat = "no-repeat"
146
+ < TwImage
147
+ className = "flex-1 basis-full bg-cover bg-no-repeat"
179
148
src = { EthBlocksImage }
180
149
alt = { t ( "page-developers-index:alt-eth-blocks" ) }
181
150
loading = "eager"
182
151
/>
183
152
</ Column >
184
153
</ Flex >
185
- < SimpleGrid minChildWidth = "min(100%, 280px)" spacing = { 8 } >
154
+ < div className = "grid grid-cols-1 gap-8 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4" >
186
155
{ frameworksList . map ( ( framework , idx ) => (
187
156
< ProductCard
188
157
key = { idx }
@@ -198,12 +167,12 @@ const LocalEnvironmentPage = ({
198
167
{ t ( framework . description ) }
199
168
</ ProductCard >
200
169
) ) }
201
- </ SimpleGrid >
170
+ </ div >
202
171
</ Content >
203
172
< Content >
204
173
< FeedbackCard />
205
174
</ Content >
206
- </ Flex >
175
+ </ VStack >
207
176
)
208
177
}
209
178
0 commit comments