From 9116d049f7f39797ceeaa4f19660249611035de1 Mon Sep 17 00:00:00 2001 From: Joe Chen Date: Wed, 29 Jan 2025 14:30:48 +0800 Subject: [PATCH 1/3] Miigrate eth page to Shadcn --- src/pages/eth.tsx | 185 ++++++++++++++++------------------------------ 1 file changed, 62 insertions(+), 123 deletions(-) diff --git a/src/pages/eth.tsx b/src/pages/eth.tsx index 9a71d8da556..38c3cdcc01c 100644 --- a/src/pages/eth.tsx +++ b/src/pages/eth.tsx @@ -1,38 +1,30 @@ import { GetStaticProps } from "next" import { useTranslation } from "next-i18next" import { serverSideTranslations } from "next-i18next/serverSideTranslations" -import type { ComponentProps } from "react" -import { - Box, - Flex, - type FlexProps, - Heading, - type HeadingProps, - ListItem, - UnorderedList, -} from "@chakra-ui/react" +import type { ComponentProps, HTMLAttributes } from "react" import type { BasePageProps, ChildOnlyProp, Lang } from "@/lib/types" import ActionCard from "@/components/ActionCard" -import ButtonLink from "@/components/Buttons/ButtonLink" import CalloutBanner from "@/components/CalloutBanner" import Card from "@/components/Card" import CardList from "@/components/CardList" import EthPriceCard from "@/components/EthPriceCard" import EthVideo from "@/components/EthVideo" import FeedbackCard from "@/components/FeedbackCard" +import Heading from "@/components/Heading" import HorizontalCard from "@/components/HorizontalCard" -import { Image } from "@/components/Image" +import { TwImage } from "@/components/Image" import InfoBanner from "@/components/InfoBanner" -import InlineLink from "@/components/Link" import MainArticle from "@/components/MainArticle" -import OldHeading from "@/components/OldHeading" -import Text from "@/components/OldText" import PageMetadata from "@/components/PageMetadata" import { StandaloneQuizWidget } from "@/components/Quiz/QuizWidget" import Translation from "@/components/Translation" +import { ButtonLink } from "@/components/ui/buttons/Button" import { Divider } from "@/components/ui/divider" +import { Flex, VStack } from "@/components/ui/flex" +import InlineLink from "@/components/ui/Link" +import { ListItem, UnorderedList } from "@/components/ui/list" import { cn } from "@/lib/utils/cn" import { existsNamespace } from "@/lib/utils/existsNamespace" @@ -46,34 +38,25 @@ import defi from "@/public/images/finance_transparent.png" import ethereum from "@/public/images/what-is-ethereum.png" const Page = (props: ChildOnlyProp) => ( - ) const Content = (props: ChildOnlyProp) => ( - +
) const GrayContainer = (props: ChildOnlyProp) => ( - ) const Intro = (props: ChildOnlyProp) => ( - +
) const StyledCard = (props: ComponentProps) => ( @@ -88,13 +71,7 @@ const StyledCard = (props: ComponentProps) => ( ) const Slogan = (props: ChildOnlyProp) => ( - +

) const Title = (props: ChildOnlyProp) => ( @@ -112,104 +89,79 @@ const Title = (props: ChildOnlyProp) => ( ) const Subtitle = (props: ChildOnlyProp) => ( - + +) + +const Text = ({ className, ...props }: HTMLAttributes) => ( +

) -export const TwoColumnContent = (props: FlexProps) => ( +export const TwoColumnContent = ({ + className, + ...props +}: HTMLAttributes) => ( ) export const LeftColumn = (props: ChildOnlyProp) => ( - ) export const RightColumn = (props: ChildOnlyProp) => ( ) const SubtitleTwo = (props: ChildOnlyProp) => ( - + ) const HeroContainer = (props: ChildOnlyProp) => ( ) const Hero = (props: ChildOnlyProp) => ( - ) const Header = (props: ChildOnlyProp) => ( - +

) -const H2 = (prop: HeadingProps) => ( - +const H2 = (props: ChildOnlyProp) => ( +

) -const H3 = (props: HeadingProps) => ( - +const H3 = (props: ChildOnlyProp) => ( +

) -const H4 = (props: HeadingProps) => ( - +const H4 = (props: ChildOnlyProp) => ( +

) -const CardContainer = (props: FlexProps) => ( - +const CardContainer = ({ + className, + ...props +}: HTMLAttributes) => ( + ) const TokenCard = (props: ComponentProps) => ( @@ -220,24 +172,11 @@ const TokenCard = (props: ComponentProps) => ( /> ) const TextDivider = () => ( - +
) const CentralColumn = (props: ChildOnlyProp) => ( - + ) const CentralActionCard = (props: ComponentProps) => ( @@ -379,7 +318,7 @@ const EthPage = () => { - { {t("page-eth-description")} - + {benefits.map((benefits, idx) => ( { ))} - {t("page-eth-buy-some")}{" "} + {t("page-eth-buy-some")}{" "} {" "} {t("page-eth-more-on-ethereum-link")} @@ -419,13 +358,13 @@ const EthPage = () => {

{t("page-eth-whats-unique")}

{t("page-eth-whats-unique-desc")} - +

{t("page-eth-fuels")}

{t("page-eth-fuels-desc")} {t("page-eth-fuels-desc-2")} {" "} - {t("page-eth-powers-ethereum")} + {t("page-eth-powers-ethereum")} {t("page-eth-period")} @@ -434,7 +373,7 @@ const EthPage = () => { {t("page-eth-fuels-more-staking")} - +
{ image={ethereum} /> - +

{t("page-eth-underpins")}

@@ -457,9 +396,9 @@ const EthPage = () => { - +
- +

{t("page-eth-uses")}

{t("page-eth-uses-desc")} {t("page-eth-uses-desc-2")} @@ -489,7 +428,7 @@ const EthPage = () => { – {t("page-eth-uses-desc-6")} - +
{ alt={t("page-eth-cat-img-alt")} imageWidth={300} > - +
{t("page-eth-get-eth-btn")} - +
@@ -521,12 +460,12 @@ const EthPage = () => { - +

{t("page-eth-not-only-crypto")}

{t("page-eth-not-only-crypto-desc")} {t("page-eth-not-only-crypto-desc-2")} -

{t("page-eth-more-on-tokens")}

+

{t("page-eth-more-on-tokens")}

From 6c8e1b942fd6f0487322bf6d1f8a0b5573a7bf8f Mon Sep 17 00:00:00 2001 From: Pablo Date: Wed, 29 Jan 2025 16:23:42 +0100 Subject: [PATCH 2/3] adjust card bg color and title component --- src/pages/eth.tsx | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/pages/eth.tsx b/src/pages/eth.tsx index 38c3cdcc01c..156387ddcb6 100644 --- a/src/pages/eth.tsx +++ b/src/pages/eth.tsx @@ -12,7 +12,6 @@ import CardList from "@/components/CardList" import EthPriceCard from "@/components/EthPriceCard" import EthVideo from "@/components/EthVideo" import FeedbackCard from "@/components/FeedbackCard" -import Heading from "@/components/Heading" import HorizontalCard from "@/components/HorizontalCard" import { TwImage } from "@/components/Image" import InfoBanner from "@/components/InfoBanner" @@ -66,6 +65,7 @@ const StyledCard = (props: ComponentProps) => ( flex="1 0 30%" minW="280px" maxW={{ base: "full", md: "46%", lg: "31%" }} + bg="background.base" {...props} /> ) @@ -75,21 +75,14 @@ const Slogan = (props: ChildOnlyProp) => ( ) const Title = (props: ChildOnlyProp) => ( - ) const Subtitle = (props: ChildOnlyProp) => ( - + ) const Text = ({ className, ...props }: HTMLAttributes) => ( From 10b09f01a8b13176a4419a286ef237dce8ba7a8d Mon Sep 17 00:00:00 2001 From: Pablo Date: Thu, 30 Jan 2025 14:12:52 +0100 Subject: [PATCH 3/3] update card bg --- src/pages/eth.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/eth.tsx b/src/pages/eth.tsx index 7b970efc8f0..7a132a61422 100644 --- a/src/pages/eth.tsx +++ b/src/pages/eth.tsx @@ -60,7 +60,7 @@ const Intro = (props: ChildOnlyProp) => ( const StyledCard = (props: ComponentProps) => ( )