Skip to content

Commit b00f1f0

Browse files
committed
Migrate assets page to Shadcn
1 parent e2fa609 commit b00f1f0

File tree

1 file changed

+23
-36
lines changed

1 file changed

+23
-36
lines changed

src/pages/assets.tsx

Lines changed: 23 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,17 @@
11
import type { GetStaticProps } from "next/types"
22
import { useTranslation } from "next-i18next"
33
import { serverSideTranslations } from "next-i18next/serverSideTranslations"
4-
import {
5-
Box,
6-
Center,
7-
Flex,
8-
Heading,
9-
type HeadingProps,
10-
SimpleGrid,
11-
type SimpleGridProps,
12-
useColorModeValue,
13-
} from "@chakra-ui/react"
144

155
import type { BasePageProps, ChildOnlyProp, Lang } from "@/lib/types"
166

177
import AssetDownload from "@/components/AssetDownload"
188
import FeedbackCard from "@/components/FeedbackCard"
19-
import { Image } from "@/components/Image"
20-
import InlineLink from "@/components/Link"
9+
import Heading from "@/components/Heading"
10+
import { TwImage } from "@/components/Image"
2111
import MainArticle from "@/components/MainArticle"
22-
import OldHeading from "@/components/OldHeading"
2312
import PageMetadata from "@/components/PageMetadata"
13+
import { Center, Flex } from "@/components/ui/flex"
14+
import InlineLink from "@/components/ui/Link"
2415

2516
import { existsNamespace } from "@/lib/utils/existsNamespace"
2617
import { getLastDeployDate } from "@/lib/utils/getLastDeployDate"
@@ -37,6 +28,7 @@ import { getLocaleTimestamp } from "@/lib/utils/time"
3728
// import leslieTheRhino from "@/public/images/upgrades/upgrade_rhino.png"
3829
import { getRequiredNamespacesForPage } from "@/lib/utils/translations"
3930

31+
import useColorModeValue from "@/hooks/useColorModeValue"
4032
import ethDiamondBlack from "@/public/images/assets/eth-diamond-black.png"
4133
import ethDiamondBlackGray from "@/public/images/assets/eth-diamond-black-gray.png"
4234
import ethDiamondBlackWhite from "@/public/images/assets/eth-diamond-black-white.jpg"
@@ -89,16 +81,17 @@ import defi from "@/public/images/use-cases/defi.png"
8981
import wallet from "@/public/images/wallet.png"
9082
import whatIsEthereum from "@/public/images/what-is-ethereum.png"
9183

92-
const Row = (props: SimpleGridProps) => (
93-
<SimpleGrid
94-
templateColumns="repeat(auto-fit, minmax(min(288px, 100%), 1fr))"
95-
mx={-4}
96-
mb="8"
84+
const Row = (props: ChildOnlyProp) => (
85+
<div
86+
className="-mx-4 mb-8 grid"
87+
style={{
88+
gridTemplateColumns: "repeat(auto-fit, minmax(min(288px, 100%), 1fr))",
89+
}}
9790
{...props}
9891
/>
9992
)
10093

101-
const H2 = (props: ChildOnlyProp & HeadingProps) => (
94+
const H2 = (props: ChildOnlyProp) => (
10295
<Heading
10396
fontSize={{ base: "2xl", md: "3xl" }}
10497
lineHeight={1.4}
@@ -110,13 +103,7 @@ const H2 = (props: ChildOnlyProp & HeadingProps) => (
110103
)
111104

112105
const H3 = (props: ChildOnlyProp) => (
113-
<OldHeading
114-
as="h3"
115-
fontSize={{ base: "xl", md: "2xl" }}
116-
lineHeight={1.4}
117-
mb="0"
118-
{...props}
119-
/>
106+
<h3 className="mb-0 mt-10 leading-xs" {...props} />
120107
)
121108

122109
export const getStaticProps = (async ({ locale }) => {
@@ -146,18 +133,18 @@ const AssetsPage = () => {
146133
ethDiamondPurple
147134
)
148135
return (
149-
<Flex direction="column" width="full">
136+
<Flex className="w-full flex-col">
150137
<PageMetadata
151138
title={t("page-assets-meta-title")}
152139
description={t("page-assets-meta-desc")}
153140
/>
154-
<Box as={MainArticle} py="4" px="8">
155-
<Flex direction="column" px="8" py="4">
141+
<MainArticle className="px-8 py-4">
142+
<Flex className="flex-col px-8 py-4">
156143
<Center>
157-
<Image
144+
<TwImage
145+
className="w-20"
158146
src={assetPageHeroImage}
159147
alt={t("page-assets-eth-diamond-gray")}
160-
w="5rem"
161148
/>
162149
</Center>
163150
<Center>
@@ -182,7 +169,7 @@ const AssetsPage = () => {
182169
</Center>
183170
</Flex>
184171

185-
<H2 id="illustrations">{t("page-assets-illustrations")}</H2>
172+
<H2>{t("page-assets-illustrations")}</H2>
186173

187174
<Row>
188175
<AssetDownload
@@ -381,8 +368,8 @@ const AssetsPage = () => {
381368
artistUrl="https://www.patrickatkins.co.uk/"
382369
/>
383370
</Row>
384-
<H2 id="historical">{t("page-assets-historical-artwork")}</H2>
385-
<H2 id="brand">{t("page-assets-ethereum-brand-assets")}</H2>
371+
<H2>{t("page-assets-historical-artwork")}</H2>
372+
<H2>{t("page-assets-ethereum-brand-assets")}</H2>
386373
<H3>{t("page-assets-page-assets-transparent-background")}</H3>
387374
<Row>
388375
<AssetDownload
@@ -548,7 +535,7 @@ const AssetsPage = () => {
548535
svgUrl="/images/assets/svgs/ethereum-wordmark-purple-white.svg"
549536
/>
550537
</Row>
551-
<H2 id="historical-illustrations">{t("page-assets-illustrations")}</H2>
538+
<H2>{t("page-assets-illustrations")}</H2>
552539
<Row>
553540
<AssetDownload
554541
title={t("page-assets-hero-panda")}
@@ -562,7 +549,7 @@ const AssetsPage = () => {
562549
svgUrl="/images/assets/svgs/merge-panda.svg"
563550
/>
564551
</Row>
565-
</Box>
552+
</MainArticle>
566553
<FeedbackCard />
567554
</Flex>
568555
)

0 commit comments

Comments
 (0)