Skip to content

Commit f3abd08

Browse files
Migrate the VStack, Heading to Tailwind.
1 parent 142610a commit f3abd08

File tree

1 file changed

+20
-31
lines changed

1 file changed

+20
-31
lines changed

src/components/Staking/StakingHierarchy.tsx

Lines changed: 20 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
import React from "react"
22
import { useTranslation } from "next-i18next"
33
import { IconBase } from "react-icons"
4-
import {
5-
cssVar,
6-
Heading,
7-
Icon,
8-
SimpleGrid,
9-
Text,
10-
useToken,
11-
VStack,
12-
} from "@chakra-ui/react"
13-
import { Center, Flex } from "@/components/ui/flex"
4+
import { cssVar, Icon, SimpleGrid, Text, useToken } from "@chakra-ui/react"
5+
import { Center, VStack, Flex } from "@/components/ui/flex"
146

157
import { ChildOnlyProp } from "@/lib/types"
168

@@ -153,15 +145,13 @@ const Header = ({ children }: ChildOnlyProp) => (
153145
)
154146

155147
const HeadingEl = ({ children }: ChildOnlyProp) => (
156-
<Heading
157-
color={$colorVar.reference}
158-
fontSize="2rem"
159-
fontWeight={600}
160-
lineHeight={1.4}
161-
textAlign={{ base: "center", md: "initial" }}
148+
<h1
149+
className="text-($colorVar.reference) text-center text-[2rem] font-semibold leading-[1.4] md:text-start"
150+
/* This value needs to be updated across the file.
151+
color={$colorVar.reference} */
162152
>
163153
{children}
164-
</Heading>
154+
</h1>
165155
)
166156
// Todo: The removed sx prop will be added by creating a separate function for Text like we have HeadingEl. This will also help to migrate the Text component.
167157
const Pills = ({ children }: ChildOnlyProp) => (
@@ -170,9 +160,18 @@ const Pills = ({ children }: ChildOnlyProp) => (
170160
</Flex>
171161
)
172162

163+
const TextEl = ({ children }: ChildOnlyProp) => (
164+
<p
165+
className={`after:content-["] relative m-0 whitespace-nowrap px-1.5 py-0.5 text-[colorVar.reference] after:absolute after:start-0 after:top-0 after:box-content after:rounded after:bg-[var(colorVar.reference)] after:opacity-[.125]`}
166+
>
167+
{children}
168+
</p>
169+
)
170+
173171
type GlyphProps = { glyphIcon: typeof IconBase }
174172
const Glyph = ({ glyphIcon }: GlyphProps) => (
175173
<Center
174+
//Need to set the base styles we've had previously ie. gridArea="base:content"
176175
style={{
177176
gridArea: "glyph",
178177
}}
@@ -212,28 +211,18 @@ const StakingHierarchy = () => {
212211
)
213212

214213
return (
215-
<VStack
216-
bgGradient="linear(rgba(237, 194, 84, 0.1) 13.39%, rgba(75, 231, 156, 0.1) 44.21%, rgba(231, 202, 200, 0.1) 82.88%)"
217-
borderRadius={{ base: 0, md: "lg" }}
218-
spacing={{ base: 16, md: 0 }}
219-
p={8}
220-
borderInlineStart={{ base: "4px", md: "none" }}
221-
borderInlineEnd={0}
222-
sx={{
223-
borderImage: `linear-gradient(to bottom, ${stakingGold} 5%, ${stakingGreen} 30%, ${stakingBlue} 55%, ${stakingRed} 80%) 1 100%`,
224-
}}
225-
>
214+
<VStack className="border-gradient-to-b border-gradient-gold-green-blue-red space-y-16 rounded-none border-l-4 border-r-0 bg-gradient-to-b from-[rgba(237,194,84,0.1)] via-[rgba(75,231,156,0.1)] to-[rgba(231,202,200,0.1)] p-8 md:space-y-0 md:rounded-lg md:border-l-0">
226215
<SectionGrid number={1}>
227216
<StyledEtherSvg className="size-[100%] text-staking-gold" />
228217
<Line />
229218
<Header>
230219
<HeadingEl>{t("page-staking-hierarchy-solo-h2")}</HeadingEl>
231220
<Pills>
232-
<p
233-
className={`after:content-["] relative m-0 whitespace-nowrap px-1.5 py-0.5 text-[colorVar.reference] after:absolute after:start-0 after:top-0 after:box-content after:rounded after:bg-[var(colorVar.reference)] after:opacity-[.125]`}
221+
<Text
222+
className={`after:content-["] relative m-0 whitespace-nowrap px-1.5 py-0.5 text-[$colorVar.reference] after:absolute after:start-0 after:top-0 after:box-content after:rounded after:bg-[$colorVar.reference] after:opacity-[.125]`}
234223
>
235224
<em>{t("page-staking-hierarchy-solo-pill-1")}</em>
236-
</p>
225+
</Text>
237226
<Text
238227
className={`after:content-["] relative m-0 whitespace-nowrap px-1.5 py-0.5 text-[$colorVar.reference] after:absolute after:start-0 after:top-0 after:box-content after:rounded after:bg-[$colorVar.reference] after:opacity-[.125]`}
239228
>

0 commit comments

Comments
 (0)