1
1
import { useRouter } from "next/router"
2
2
import { useTranslation } from "next-i18next"
3
- import { Box , Center , Flex } from "@chakra-ui/react"
4
3
5
4
import type { ChildOnlyProp , Lang } from "@/lib/types"
6
5
7
6
import CardList from "@/components/CardList"
8
7
import Emoji from "@/components/Emoji"
9
- import InlineLink from "@/components/Link"
10
- import OldHeading from "@/components/OldHeading"
11
- import Text from "@/components/OldText"
12
8
import Select from "@/components/ui/Select"
13
9
14
10
import { getLocaleTimestamp } from "@/lib/utils/time"
15
11
16
12
import { WEBSITE_EMAIL } from "@/lib/constants"
17
13
14
+ import InlineLink from "../ui/Link"
15
+
18
16
import { useCentralizedExchanges } from "@/hooks/useCentralizedExchanges"
19
17
20
18
const ListContainer = ( props : ChildOnlyProp ) => (
21
- < Box mt = { 16 } flex = { { base : "1 1 100%" , md : "1 1 50%" } } { ...props } />
19
+ < div className = "mt-16 flex flex-col gap-4" { ...props } />
22
20
)
23
21
24
22
const ResultsContainer = ( props : ChildOnlyProp ) => (
25
- < Flex
26
- justify = "center"
27
- w = "full"
28
- maxWidth = "876px"
29
- flexWrap = { { base : "wrap" , md : "initial" } }
30
- sx = { {
31
- "& > *" : {
32
- _first : {
33
- me : { base : 0 , md : 6 } ,
34
- } ,
35
- } ,
36
- } }
23
+ < div
24
+ className = "flex w-full max-w-screen-md flex-wrap justify-center md:flex-nowrap first:md:me-6"
37
25
{ ...props }
38
26
/>
39
27
)
40
28
41
29
const EmptyStateContainer = ( props : ChildOnlyProp ) => (
42
- < Center flexDir = "column" mt = { 16 } { ...props } />
30
+ < div className = "mt-16 flex flex-col items-center justify-center" { ...props } />
43
31
)
44
32
45
33
const SuccessContainer = ( props : ChildOnlyProp ) => (
46
- < Flex flexDir = "column" mt = { 4 } { ...props } />
34
+ < div className = "flex flex-col gap-4" { ...props } />
47
35
)
48
36
49
37
const EmptyStateText = ( props : ChildOnlyProp ) => (
50
- < Text m = { 8 } fontSize = "xl" maxW = " 450px" textAlign = " center" { ...props } />
38
+ < p className = "m-8 max-w-[ 450px] text- center text-xl " { ...props } />
51
39
)
52
40
53
41
const NoResults = ( { children } ) => (
@@ -62,14 +50,14 @@ const NoResults = ({ children }) => (
62
50
)
63
51
64
52
const NoResultsSingle = ( { children } ) => (
65
- < Center flexDir = "column" mt = { 6 } >
66
- < Text maxW = "450px" mb = { 16 } >
53
+ < div className = "mt-6 flex flex-col items-center justify-center" >
54
+ < p className = "mb-16 max-w-[450px]" >
67
55
{ /* TODO: Fix `children` structure to include email link within i18n string */ }
68
56
{ children } { " " }
69
57
< InlineLink href = { `mailto:${ WEBSITE_EMAIL } ` } > { WEBSITE_EMAIL } </ InlineLink > .
70
- </ Text >
58
+ </ p >
71
59
< Emoji text = ":crying_face:" className = "text-[80px]" />
72
- </ Center >
60
+ </ div >
73
61
)
74
62
75
63
type CentralizedExchangesProps = { lastDataUpdateDate : string }
@@ -91,18 +79,12 @@ const CentralizedExchanges = ({
91
79
const lastUpdated = getLocaleTimestamp ( locale as Lang , lastDataUpdateDate )
92
80
93
81
return (
94
- < Flex flexDir = "column" align = "center" w = "full" >
95
- < OldHeading
96
- fontSize = { { base : "2xl" , md : "2rem" } }
97
- fontWeight = { 600 }
98
- lineHeight = { 1.4 }
99
- >
100
- { t ( "page-get-eth-exchanges-header" ) }
101
- </ OldHeading >
102
- < Text maxW = "container.sm" mb = { 8 } lineHeight = { 1.4 } textAlign = "center" >
82
+ < div className = "flex flex-col items-center" >
83
+ < h2 className = "mb-4" > { t ( "page-get-eth-exchanges-header" ) } </ h2 >
84
+ < p className = "mb-8 max-w-screen-md text-center" >
103
85
{ t ( "page-get-eth-exchanges-intro" ) }
104
- </ Text >
105
- < Box w = " full" maxW = "container. sm">
86
+ </ p >
87
+ < div className = "w- full max-w-screen- sm">
106
88
< Select
107
89
instanceId = "eth-exchange-region"
108
90
aria-label = { t ( "page-get-eth-exchanges-header" ) }
@@ -112,7 +94,7 @@ const CentralizedExchanges = ({
112
94
isSearchable
113
95
variant = "outline"
114
96
/>
115
- </ Box >
97
+ </ div >
116
98
{ ! hasSelectedCountry && (
117
99
< EmptyStateContainer >
118
100
< Emoji text = ":world_map:" className = "text-[80px]" />
@@ -134,17 +116,12 @@ const CentralizedExchanges = ({
134
116
< >
135
117
< ResultsContainer >
136
118
< ListContainer >
137
- < OldHeading
138
- as = "h3"
139
- fontSize = { { base : "xl" , md : "2xl" } }
140
- fontWeight = { 600 }
141
- lineHeight = { 1.4 }
142
- >
119
+ < h3 className = "text-xl font-semibold md:text-2xl" >
143
120
{ t ( "page-get-eth-exchanges-header-exchanges" ) }
144
- </ OldHeading >
121
+ </ h3 >
145
122
{ hasExchangeResults && (
146
123
< SuccessContainer >
147
- < Text > { t ( "page-get-eth-exchanges-success-exchange" ) } </ Text >
124
+ < p > { t ( "page-get-eth-exchanges-success-exchange" ) } </ p >
148
125
< CardList items = { filteredExchanges } />
149
126
</ SuccessContainer >
150
127
) }
@@ -155,17 +132,17 @@ const CentralizedExchanges = ({
155
132
) }
156
133
</ ListContainer >
157
134
</ ResultsContainer >
158
- < Text w = "full" maxW = "876px" mt = { 16 } mb = { 0 } >
135
+ < p className = "mt-16 max-w-screen-lg" >
159
136
{ t ( "page-get-eth-exchanges-disclaimer" ) } { " " }
160
137
< InlineLink href = { `mailto:${ WEBSITE_EMAIL } ` } >
161
138
{ WEBSITE_EMAIL }
162
139
</ InlineLink >
163
140
. { t ( "page-find-wallet-last-updated" ) } { " " }
164
141
< strong > { lastUpdated } </ strong >
165
- </ Text >
142
+ </ p >
166
143
</ >
167
144
) }
168
- </ Flex >
145
+ </ div >
169
146
)
170
147
}
171
148
0 commit comments