Skip to content

Commit b16fd03

Browse files
feat(Simulator/index): migrate to Tailwind
1 parent 106b8f9 commit b16fd03

File tree

1 file changed

+11
-32
lines changed

1 file changed

+11
-32
lines changed

src/components/Simulator/index.tsx

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import React, { useEffect, useMemo, useState } from "react"
1+
import { type ReactNode, useEffect, useMemo, useState } from "react"
22
import { useRouter } from "next/router"
3-
import { Flex, type FlexProps, Grid } from "@chakra-ui/react"
43

54
import { trackCustomEvent } from "@/lib/utils/matomo"
65

76
import type { ModalProps } from "../ui/dialog-modal"
7+
import { Flex } from "../ui/flex"
88

99
import { PATH_ID_QUERY_PARAM, SIMULATOR_ID } from "./constants"
1010
import { Explanation } from "./Explanation"
@@ -20,7 +20,8 @@ import { Template } from "./Template"
2020
import type { PathId, SimulatorData } from "./types"
2121
import { getValidPathId } from "./utils"
2222

23-
type SimulatorProps = Pick<FlexProps, "children"> & {
23+
type SimulatorProps = {
24+
children: ReactNode
2425
data: SimulatorData
2526
}
2627
export const Simulator = ({ children, data }: SimulatorProps) => {
@@ -130,37 +131,15 @@ export const Simulator = ({ children, data }: SimulatorProps) => {
130131
}
131132

132133
return (
133-
<Grid
134+
<div
134135
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%"
141137
>
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">
153139
{/* TEXT CONTENT */}
154-
<Flex direction="column" px={4}>
155-
{children}
156-
</Flex>
140+
<Flex className="flex-col px-4">{children}</Flex>
157141
{/* 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]">
164143
{Object.keys(data).map((id) => {
165144
const sim = data[id]
166145
const pathSummary = {
@@ -205,7 +184,7 @@ export const Simulator = ({ children, data }: SimulatorProps) => {
205184
logFinalCta={logFinalCta}
206185
/>
207186
) : (
208-
<Flex flex={1} minH={32} />
187+
<Flex className="min-h-32 flex-1" />
209188
)}
210189
{Screen && (
211190
<Phone>
@@ -214,6 +193,6 @@ export const Simulator = ({ children, data }: SimulatorProps) => {
214193
)}
215194
</Template>
216195
</SimulatorModal>
217-
</Grid>
196+
</div>
218197
)
219198
}

0 commit comments

Comments
 (0)