1
- import React , { useEffect , useMemo , useState } from "react"
1
+ import { type ReactNode , useEffect , useMemo , useState } from "react"
2
2
import { useRouter } from "next/router"
3
- import { Flex , type FlexProps , Grid } from "@chakra-ui/react"
4
3
5
4
import { trackCustomEvent } from "@/lib/utils/matomo"
6
5
7
6
import type { ModalProps } from "../ui/dialog-modal"
7
+ import { Flex } from "../ui/flex"
8
8
9
9
import { PATH_ID_QUERY_PARAM , SIMULATOR_ID } from "./constants"
10
10
import { Explanation } from "./Explanation"
@@ -20,7 +20,8 @@ import { Template } from "./Template"
20
20
import type { PathId , SimulatorData } from "./types"
21
21
import { getValidPathId } from "./utils"
22
22
23
- type SimulatorProps = Pick < FlexProps , "children" > & {
23
+ type SimulatorProps = {
24
+ children : ReactNode
24
25
data : SimulatorData
25
26
}
26
27
export const Simulator = ( { children, data } : SimulatorProps ) => {
@@ -130,37 +131,15 @@ export const Simulator = ({ children, data }: SimulatorProps) => {
130
131
}
131
132
132
133
return (
133
- < Grid
134
+ < div
134
135
id = { SIMULATOR_ID }
135
- bg = "cardGradient"
136
- placeItems = "center"
137
- p = { { base : 4 , md : 16 } }
138
- w = "full"
139
- scrollMarginTop = { { base : "5rem" } }
140
- scrollBehavior = "smooth"
136
+ className = "grid w-full scroll-mt-[5rem] place-items-center scroll-smooth bg-gradient-to-r from-accent-a/10 to-accent-c/10 p-4 md:p-16 dark:bg-gradient-to-tr dark:from-primary/20 dark:from-20% dark:via-accent-a/20 dark:via-60% dark:to-accent-c/20 dark:to-95%"
141
137
>
142
- < Flex
143
- direction = { { base : "column" , md : "row" } }
144
- bg = "background.base"
145
- px = { { base : 4 , md : 16 } }
146
- py = { { base : 8 , md : 16 } }
147
- alignItems = "center"
148
- textAlign = { { base : "center" , md : "start" } }
149
- gap = { { base : 16 , md : 8 , lg : 16 } }
150
- maxW = "1000px"
151
- w = "full"
152
- >
138
+ < Flex className = "w-full max-w-[1000px] items-center gap-16 bg-background px-4 py-8 text-center max-md:flex-col md:p-16 md:text-start md:max-lg:gap-8" >
153
139
{ /* TEXT CONTENT */ }
154
- < Flex direction = "column" px = { 4 } >
155
- { children }
156
- </ Flex >
140
+ < Flex className = "flex-col px-4" > { children } </ Flex >
157
141
{ /* Button stack for path options */ }
158
- < Flex
159
- direction = "column"
160
- gap = { 8 }
161
- w = { { base : "min(100%, 320px)" , md : "300px" } }
162
- minW = { { md : "300px" } }
163
- >
142
+ < Flex className = "w-[min(100%,_320px)] flex-col gap-8 md:w-[300px]" >
164
143
{ Object . keys ( data ) . map ( ( id ) => {
165
144
const sim = data [ id ]
166
145
const pathSummary = {
@@ -205,7 +184,7 @@ export const Simulator = ({ children, data }: SimulatorProps) => {
205
184
logFinalCta = { logFinalCta }
206
185
/>
207
186
) : (
208
- < Flex flex = { 1 } minH = { 32 } />
187
+ < Flex className = "min-h-32 flex-1" />
209
188
) }
210
189
{ Screen && (
211
190
< Phone >
@@ -214,6 +193,6 @@ export const Simulator = ({ children, data }: SimulatorProps) => {
214
193
) }
215
194
</ Template >
216
195
</ SimulatorModal >
217
- </ Grid >
196
+ </ div >
218
197
)
219
198
}
0 commit comments