diff --git a/src/components/ui/Table.tsx b/src/components/ui/Table.tsx index b7255adae9d..64e0bd52839 100644 --- a/src/components/ui/Table.tsx +++ b/src/components/ui/Table.tsx @@ -166,6 +166,18 @@ const TableCell = React.forwardRef< }) TableCell.displayName = "TableCell" +const TableCaption = React.forwardRef< + HTMLTableCaptionElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( + +)) +TableCaption.displayName = "TableCaption" + const mdxTableComponents = { table: Table, td: ({ align, ...rest }) => , @@ -179,6 +191,7 @@ export { mdxTableComponents, Table, TableBody, + TableCaption, TableCell, TableHead, TableHeader, diff --git a/src/pages/gas.tsx b/src/pages/gas.tsx index 45564a216c0..2e372181d54 100644 --- a/src/pages/gas.tsx +++ b/src/pages/gas.tsx @@ -1,28 +1,10 @@ -import { ComponentPropsWithRef } from "react" +import { BaseHTMLAttributes, ComponentPropsWithRef } from "react" import { GetStaticProps } from "next/types" import { useTranslation } from "next-i18next" import { serverSideTranslations } from "next-i18next/serverSideTranslations" -import { - Box, - BoxProps, - Flex, - FlexProps, - HeadingProps, - Link, - ListItem, - Table, - TableCaption, - Tbody, - Td, - Th, - Thead, - Tr, - UnorderedList, -} from "@chakra-ui/react" import { BasePageProps, Lang } from "@/lib/types" -import { ButtonLink } from "@/components/Buttons" import Callout from "@/components/Callout" import Card from "@/components/Card" import Emoji from "@/components/Emoji" @@ -30,18 +12,29 @@ import ExpandableCard from "@/components/ExpandableCard" import FeedbackCard from "@/components/FeedbackCard" import GhostCard from "@/components/GhostCard" 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 PageHero from "@/components/PageHero" import PageMetadata from "@/components/PageMetadata" import Translation from "@/components/Translation" +import { ButtonLink } from "@/components/ui/buttons/Button" import { Divider } from "@/components/ui/divider" +import { Flex, FlexProps } from "@/components/ui/flex" +import InlineLink, { BaseLink } from "@/components/ui/Link" +import { ListItem, UnorderedList } from "@/components/ui/list" +import { + Table, + TableBody, + TableCaption, + TableCell, + TableHead, + TableHeader, + TableRow, +} from "@/components/ui/Table" import { Tag } from "@/components/ui/tag" +import { cn } from "@/lib/utils/cn" import { existsNamespace } from "@/lib/utils/existsNamespace" import { getLastDeployDate } from "@/lib/utils/getLastDeployDate" import { getLocaleTimestamp } from "@/lib/utils/time" @@ -54,18 +47,20 @@ import infrastructureTransparentImg from "@/public/images/infrastructure_transpa import walletImg from "@/public/images/wallet.png" import whatIsEthereumImg from "@/public/images/what-is-ethereum.png" -const Content = (props: BoxProps) => +const Content = ({ + className, + ...props +}: BaseHTMLAttributes) => ( +
+) -const Page = (props: FlexProps) => ( +const Page = ({ className, ...props }: FlexProps) => ( + asChild + className={cn("mx-auto my-0 w-full flex-col items-center", className)} + > + + ) export const StyledCard = (props: ComponentPropsWithRef) => ( @@ -75,21 +70,18 @@ export const StyledCard = (props: ComponentPropsWithRef) => ( /> ) -const H2 = (props: HeadingProps) => ( - +const H2 = ({ + className, + ...props +}: BaseHTMLAttributes) => ( +

) -const H3 = (props: HeadingProps) => ( - +const H3 = ({ + className, + ...props +}: BaseHTMLAttributes) => ( +

) export const getStaticProps = (async ({ locale }) => { @@ -157,7 +149,7 @@ const GasPage = () => { description={t("page-gas-meta-description")} />
- +
{ ...heroContent, }} /> - +
- - - + + +
{t("page-gas-summary-item-1")} @@ -186,36 +174,28 @@ const GasPage = () => { {t("page-gas-summary-item-3")} -

+

{t("page-gas-what-are-gas-fees-header")}

- {t("page-gas-what-are-gas-fees-text-1")} - +

{t("page-gas-what-are-gas-fees-text-1")}

+

- - +

+
- - A robot - +
+ +
- - - -

{t("page-gas-how-do-i-pay-less-gas-header")}

- {t("page-gas-how-do-i-pay-less-gas-text")} - + + +
+

+ {t("page-gas-how-do-i-pay-less-gas-header")} +

+

{t("page-gas-how-do-i-pay-less-gas-text")}

+ { "page-gas-how-do-i-pay-less-gas-card-3-description" )} > - + {t("page-gas-try-layer-2")} - +
- - - -

{t("page-gas-what-causes-high-gas-fees-header")}

- {t("page-gas-what-causes-high-gas-fees-text-1")} - + + +
+

+ {t("page-gas-what-causes-high-gas-fees-header")} +

+

+ {t("page-gas-what-causes-high-gas-fees-text-1")} +

+

- - {t("page-gas-what-causes-high-gas-fees-text-3")} - +

+

+ {t("page-gas-what-causes-high-gas-fees-text-3")} +

+

{t("page-gas-want-to-dive-deeper")}{" "} {t("page-gas-check-out-the-developer-docs")} - - +

+

{t("page-gas-attack-of-the-cryptokitties-header")}

- {t("page-gas-attack-of-the-cryptokitties-text")} +

+ {t("page-gas-attack-of-the-cryptokitties-text")} +

- - - - -

{t("page-gas-why-do-we-need-gas-header")}

- {t("page-gas-why-do-we-need-gas-text")} -
+ + +
+
+

+ {t("page-gas-why-do-we-need-gas-header")} +

+

{t("page-gas-why-do-we-need-gas-text")}

+
{benefits.map((benefit, index) => ( - +
- +
))} -
- - +
+ - +
- - - - -

{t("page-gas-how-is-gas-calculated-header")}

+ + +
+ +

+ {t("page-gas-how-is-gas-calculated-header")} +

- + {t("page-gas-advanced")}
- {t("page-gas-how-is-gas-calculated-text-1")} - +

{t("page-gas-how-is-gas-calculated-text-1")}

+ @@ -329,83 +307,89 @@ const GasPage = () => { - - + + - +

- - - - +

+ +
+ - - - - - - - - - - - - - - - - - - - - - - - - + + + {t("page-gas-table-header-1")} + {t("page-gas-table-header-2")} + + + + + + {t("page-gas-table-item-1-transaction-type")} + + 21,000 + + + + {t("page-gas-table-item-2-transaction-type")} + + 65,000 + + + + {t("page-gas-table-item-3-transaction-type")} + + 84,904 + + + + {t("page-gas-table-item-4-transaction-type")} + + 184,523 + +
{t("page-gas-table-header-1")}{t("page-gas-table-header-2")}
{t("page-gas-table-item-1-transaction-type")}21,000
{t("page-gas-table-item-2-transaction-type")}65,000
{t("page-gas-table-item-3-transaction-type")}84,904
{t("page-gas-table-item-4-transaction-type")}184,523
-

{t("page-gas-faq-header")}

+

{t("page-gas-faq-header")}

{/* MaxWidth will be enforced by FAQ component once implemented */} - +
- +

- - +

+

- +

- +

- - +

+ - +
- +

- - {t("page-gas-faq-question-3-a-2")} +

+

{t("page-gas-faq-question-3-a-2")}

- +
- - + { "page-gas-how-do-i-pay-less-gas-card-3-description" )} > - +
{t("page-gas-use-layer-2")} - - - + + { "page-community:page-community-explore-dapps-description" )} > - +
{t("page-community:page-community-explore-dapps")} - - +
+