Skip to content

Commit f85a686

Browse files
feat(pages/roadmap/vision): migrate to Tailwind
1 parent a45bb78 commit f85a686

File tree

1 file changed

+40
-42
lines changed

1 file changed

+40
-42
lines changed

src/pages/roadmap/vision.tsx

Lines changed: 40 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,11 @@ import { GetStaticProps } from "next"
22
import { useRouter } from "next/router"
33
import { useTranslation } from "next-i18next"
44
import { serverSideTranslations } from "next-i18next/serverSideTranslations"
5-
import type { ComponentPropsWithRef } from "react"
6-
import {
7-
Box,
8-
Flex,
9-
type FlexProps,
10-
Heading,
11-
type HeadingProps,
12-
List,
13-
ListItem,
14-
useToken,
15-
} from "@chakra-ui/react"
5+
import type {
6+
ComponentProps,
7+
ComponentPropsWithRef,
8+
CSSProperties,
9+
} from "react"
1610

1711
import type { BasePageProps, ChildOnlyProp, Lang } from "@/lib/types"
1812

@@ -24,67 +18,68 @@ import FeedbackCard from "@/components/FeedbackCard"
2418
import InfoBanner from "@/components/InfoBanner"
2519
import InlineLink from "@/components/Link"
2620
import MainArticle from "@/components/MainArticle"
27-
import OldHeading from "@/components/OldHeading"
2821
import Text from "@/components/OldText"
2922
import PageHero, {
3023
type ContentType as PageHeroContent,
3124
} from "@/components/PageHero"
3225
import PageMetadata from "@/components/PageMetadata"
3326
import Trilemma from "@/components/Trilemma"
3427
import { Divider } from "@/components/ui/divider"
28+
import { Flex, type FlexProps, VStack } from "@/components/ui/flex"
29+
import { List, ListItem } from "@/components/ui/list"
3530

31+
import { cn } from "@/lib/utils/cn"
3632
import { existsNamespace } from "@/lib/utils/existsNamespace"
3733
import { getLastDeployDate } from "@/lib/utils/getLastDeployDate"
34+
import { screens } from "@/lib/utils/screen"
3835
import { getLocaleTimestamp } from "@/lib/utils/time"
3936
import { getRequiredNamespacesForPage } from "@/lib/utils/translations"
4037

4138
import oldship from "@/public/images/upgrades/oldship.png"
4239

4340
const Page = (props: ChildOnlyProp) => (
44-
<Flex
45-
as={MainArticle}
46-
direction="column"
47-
align="center"
48-
w="full"
49-
{...props}
50-
/>
41+
<VStack className="w-full gap-0" {...props} asChild>
42+
<MainArticle {...props} />
43+
</VStack>
5144
)
5245

5346
const PageContent = (props: ChildOnlyProp) => (
54-
<Flex flexDirection="column" gap="8" py={4} px={8} w="full" {...props} />
47+
<Flex className="w-full flex-col gap-8 px-8 py-4" {...props} />
5548
)
5649

57-
const H2 = (props: HeadingProps) => (
58-
<Heading
59-
as="h2"
60-
mb={8}
61-
fontSize={{ base: "2xl", md: "2rem" }}
62-
fontWeight="semibold"
63-
lineHeight={1.4}
50+
const H2 = ({ className, ...props }: ComponentProps<"h2">) => (
51+
<h2
52+
className={cn(
53+
"mb-8 text-2xl font-semibold leading-[1.4] md:text-[2rem]",
54+
className
55+
)}
6456
{...props}
6557
/>
6658
)
6759

68-
const CenterH2 = (props: HeadingProps) => <H2 textAlign="center" {...props} />
60+
const CenterH2 = (props: Omit<ComponentProps<"h2">, "className">) => (
61+
<H2 className="text-center" {...props} />
62+
)
6963

70-
const H3 = (props: HeadingProps) => (
71-
<OldHeading
72-
as="h3"
73-
fontSize={{ base: "xl", md: "2xl" }}
74-
fontWeight="semibold"
75-
lineHeight={1.4}
64+
const H3 = (props: Omit<ComponentProps<"h3">, "className">) => (
65+
<h3
66+
className="mb-8 mt-10 text-xl font-semibold leading-[1.4] md:text-2xl"
7667
{...props}
7768
/>
7869
)
7970

80-
const CardContainer = (props: FlexProps) => (
81-
<Flex wrap="wrap" mx={-4} {...props} />
71+
const CardContainer = ({ className, ...props }: FlexProps) => (
72+
<Flex className={cn("-mx-4 flex-wrap", className)} {...props} />
8273
)
8374

8475
const ProblemCardContainer = (props: ChildOnlyProp) => {
85-
const containerMaxWidth = useToken("breakpoints", ["lg"])
86-
87-
return <CardContainer maxW={containerMaxWidth} m="0 auto" {...props} />
76+
return (
77+
<CardContainer
78+
style={{ "--container-max-w": screens.lg } as CSSProperties}
79+
className="mx-auto max-w-[var(--container-max-w)]"
80+
{...props}
81+
/>
82+
)
8883
}
8984

9085
const CentreCard = (props: ComponentPropsWithRef<typeof Card>) => (
@@ -95,11 +90,14 @@ const CentreCard = (props: ComponentPropsWithRef<typeof Card>) => (
9590
)
9691

9792
const CentralContent = (props: ChildOnlyProp) => (
98-
<Box my={0} mx={{ base: 0, lg: 48 }} {...props} />
93+
<div className="lg:mx-48" {...props} />
9994
)
10095

10196
const TrilemmaContent = (props: ChildOnlyProp) => (
102-
<Box w="full" my={8} mx={0} p={8} background="cardGradient" {...props} />
97+
<div
98+
className="my-8 w-full bg-gradient-to-r from-accent-a/10 to-accent-c/10 p-8"
99+
{...props}
100+
/>
103101
)
104102

105103
export const getStaticProps = (async ({ locale }) => {
@@ -162,7 +160,7 @@ const VisionPage = () => {
162160
<Text>{t("page-roadmap-vision-upgrade-needs-desc")}</Text>
163161
<Text>{t("page-roadmap-vision-upgrade-needs-desc-2")}</Text>
164162
<Text>{t("page-roadmap-vision-upgrade-needs-desc-3")} </Text>
165-
<List listStyleType="disc">
163+
<List className="list-disc">
166164
<ListItem>
167165
<InlineLink href="https://members.delphidigital.io/reports/the-hitchhikers-guide-to-ethereum">
168166
{t("page-roadmap-vision-2022")}

0 commit comments

Comments
 (0)