diff --git a/src/pages/staking/index.tsx b/src/pages/staking/index.tsx index f69edf9a3ad..05b18512967 100644 --- a/src/pages/staking/index.tsx +++ b/src/pages/staking/index.tsx @@ -1,8 +1,7 @@ -import { ReactNode } from "react" +import { type HTMLAttributes, ReactNode } from "react" import { GetStaticProps, InferGetStaticPropsType } from "next" import { useTranslation } from "next-i18next" import { serverSideTranslations } from "next-i18next/serverSideTranslations" -import { Box, Flex, Grid, HeadingProps, useToken } from "@chakra-ui/react" import type { BasePageProps, @@ -14,27 +13,30 @@ import type { } from "@/lib/types" import { List as ButtonDropdownList } from "@/components/ButtonDropdown" -import ButtonLink, { ButtonLinkProps } from "@/components/Buttons/ButtonLink" +import ButtonLink, { + type ButtonLinkProps, +} from "@/components/Buttons/ButtonLink" import Card from "@/components/Card" import ExpandableCard from "@/components/ExpandableCard" import FeedbackCard from "@/components/FeedbackCard" import LeftNavBar from "@/components/LeftNavBar" -import InlineLink from "@/components/Link" import { ContentContainer, MobileButton, MobileButtonDropdown, Page, } from "@/components/MdComponents" -import OldHeading from "@/components/OldHeading" -import Text from "@/components/OldText" import PageHero from "@/components/PageHero" import PageMetadata from "@/components/PageMetadata" import StakingCommunityCallout from "@/components/Staking/StakingCommunityCallout" import StakingHierarchy from "@/components/Staking/StakingHierarchy" import StakingStatsBox from "@/components/Staking/StakingStatsBox" import Translation from "@/components/Translation" +import { Flex, Stack, 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" import { getLastDeployDate } from "@/lib/utils/getLastDeployDate" import { runOnlyOnce } from "@/lib/utils/runOnlyOnce" @@ -54,85 +56,40 @@ type BenefitsType = { } const PageContainer = (props: ChildOnlyProp) => ( - + ) const Divider = () => ( - +
) const HeroStatsWrapper = (props: ChildOnlyProp) => ( - + ) const ComparisonGrid = (props: ChildOnlyProp) => { - const gridAreas = { - base: `"solo-title" - "solo-rewards" - "solo-risks" - "solo-reqs" - "solo-cta" - "saas-title" - "saas-rewards" - "saas-risks" - "saas-reqs" - "saas-cta" - "pool-title" - "pool-rewards" - "pool-risks" - "pool-reqs" - "pool-cta";`, - xl: `"solo-title saas-title pool-title" - "solo-rewards saas-rewards pool-rewards" - "solo-risks saas-risks pool-risks" - "solo-reqs saas-reqs pool-reqs" - "solo-cta saas-cta pool-cta"`, - } return ( - + /> ) } -const H2 = (props: HeadingProps) => ( - +const H2 = (props: HTMLAttributes) => ( +

) const ColorH3 = ({ color, children, -}: Pick) => ( - - {children} - +}: { + color: `text-${string} dark:text-${string}` + children: ReactNode +}) =>

{children}

+ +const H4 = (props: HTMLAttributes) => ( +

) const StyledButtonLink = ({ @@ -143,11 +100,7 @@ const StyledButtonLink = ({ ) const CardGrid = (props: ChildOnlyProp) => ( - +
) const StyledCard = (props: { @@ -239,9 +192,6 @@ const StakingPage = ({ }: InferGetStaticPropsType) => { const { t } = useTranslation("page-staking") - // TODO: Replace with direct token implementation after UI migration is completed - const lgBp = useToken("breakpoints", "lg") - const heroContent = { title: t("page-staking-hero-title"), header: t("page-staking-hero-header"), @@ -382,23 +332,23 @@ const StakingPage = ({ - {/* TODO: Switch to `above="lg"` after completion of Chakra Migration */} - - + +

{tocItems.whatIsStaking.title}

- +

- - - +

+
+

{tocItems.whyStakeYourEth.title}

@@ -418,234 +368,203 @@ const StakingPage = ({ ) )} - - +
+

{tocItems.howToStakeYourEth.title}

- {t("page-staking-section-why-p1")} - {t("page-staking-section-why-p2")} - + +

{t("page-staking-section-why-p1")}

+

{t("page-staking-section-why-p2")}

+
+
- -

+

+

- +
- +

{tocItems.comparisonOfOptions.title}

- {t("page-staking-section-comparison-subtitle")} +

+ {t("page-staking-section-comparison-subtitle")} +

- + {t("page-staking-dropdown-solo")} -
- - {t("page-staking-section-comparison-rewards-title")} - -
    -
  • +
    +

    {t("page-staking-section-comparison-rewards-title")}

    + + {t("page-staking-section-comparison-solo-rewards-li1")} -
  • -
  • + + {t("page-staking-section-comparison-solo-rewards-li2")} -
  • -
  • + + {t("page-staking-section-comparison-solo-rewards-li3")} -
  • -
+ +
-
- - {t("page-staking-section-comparison-risks-title")} - -
    -
  • +
    +

    {t("page-staking-section-comparison-risks-title")}

    + + {t("page-staking-section-comparison-solo-risks-li1")} -
  • -
  • + + {t("page-staking-section-comparison-solo-risks-li2")} -
  • -
  • + + {t("page-staking-section-comparison-solo-risks-li3")} -
  • -
+ +
-
- +
+

{t("page-staking-section-comparison-requirements-title")} - -
    -
  • +

+ + - -
  • + + -
  • -
  • + + -
  • - +
    +
    -
    +
    {t("page-staking-more-on-solo")}
    - + {t("page-staking-dropdown-saas")} -
    - - {t("page-staking-section-comparison-rewards-title")} - -
      -
    • +
      +

      {t("page-staking-section-comparison-rewards-title")}

      + + {t("page-staking-section-comparison-saas-rewards-li1")} -
    • -
    • + + {t("page-staking-section-comparison-saas-rewards-li2")} -
    • -
    + +
    -
    - - {t("page-staking-section-comparison-risks-title")} - -
      -
    • +
      +

      {t("page-staking-section-comparison-risks-title")}

      + + {t("page-staking-section-comparison-saas-risks-li1")} -
    • -
    • + + {t("page-staking-section-comparison-saas-risks-li2")} -
    • -
    + +
    -
    - +
    +

    {t("page-staking-section-comparison-requirements-title")} - -
      -
    • +

    + + - -
  • + + -
  • -
  • + + -
  • - +
    +
    -
    +
    {t("page-staking-more-on-saas")}
    - + {t("page-staking-dropdown-pools")} -
    - - {t("page-staking-section-comparison-rewards-title")} - -
      -
    • +
      +

      {t("page-staking-section-comparison-rewards-title")}

      + + -
    • -
    • + + -
    • -
    • + + -
    • -
    + +
    -
    - - {t("page-staking-section-comparison-risks-title")} - -
      -
    • +
      +

      {t("page-staking-section-comparison-risks-title")}

      + + -
    • -
    • + + -
    • -
    + +
    -
    - +
    +

    {t("page-staking-section-comparison-requirements-title")} - -
      -
    • +

    + + - -
  • + + -
  • - +
    +
    -
    +
    {t("page-staking-more-on-pools")}
    - +
    - +

    {tocItems.faq.title}

    - {t("page-staking-faq-4-answer-p1")} - {t("page-staking-faq-4-answer-p2")} - {t("page-staking-faq-4-answer-p3")} - - {t("page-upgrades-merge-btn")} - + +

    {t("page-staking-faq-4-answer-p1")}

    +

    {t("page-staking-faq-4-answer-p2")}

    +

    {t("page-staking-faq-4-answer-p3")}

    + + {t("page-upgrades-merge-btn")} + +
    - {t("page-staking-faq-5-answer-p1")} - {t("page-staking-faq-5-answer-p2")} - - {t("page-staking-faq-5-answer-link")} - + +

    {t("page-staking-faq-5-answer-p1")}

    +

    {t("page-staking-faq-5-answer-p2")}

    + + {t("page-staking-faq-5-answer-link")} + +
    @@ -654,16 +573,18 @@ const StakingPage = ({ {t("page-staking-faq-2-answer")} - {t("page-staking-faq-3-answer-p1")} - - - + +

    {t("page-staking-faq-3-answer-p1")}

    +

    + +

    +
    - - +
    +

    {tocItems.further.title}

    -
      -
    • + + {t("page-staking-further-reading-2-link")} {" "} @@ -671,44 +592,44 @@ const StakingPage = ({ {t("page-staking-further-reading-author-vitalik-buterin")} -
    • -
    • + + {t("page-staking-further-reading-4-link")} {" "} - {t("page-staking-further-reading-4-author")} -
    • -
    • + + {t("page-staking-further-reading-5-link")} {" "} - {t("page-staking-further-reading-5-author")} -
    • -
    • + + {t("page-staking-further-reading-6-link")} -
    • -
    • + + {t("page-staking-further-reading-8-link")} -
    • -
    • + + {t("page-staking-further-reading-9-link")} -
    • -
    • + + {t("page-staking-further-reading-10-link")} -
    • -
    - - + + +
    +
    - +
    diff --git a/tailwind.config.ts b/tailwind.config.ts index 6108afb7b72..3d38dc0519f 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -2,7 +2,7 @@ import type { Config } from "tailwindcss" import plugin from "tailwindcss/plugin" const config = { - darkMode: ["class"], + darkMode: ["selector", "[data-theme='dark']"], content: [ "./src/**/*.{ts,tsx}", // TODO: remove after migration