Skip to content

Commit f7d2e87

Browse files
revert(pages/what-is-ethereum): revert import location for link, button
1 parent 0aa483a commit f7d2e87

File tree

2 files changed

+10
-16
lines changed

2 files changed

+10
-16
lines changed

src/pages/what-is-ethereum.tsx

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ import {
2020
BannerGridCell,
2121
BannerImage,
2222
} from "@/components/BannerGrid"
23+
import { Button, ButtonLink } from "@/components/Buttons"
2324
import Callout from "@/components/Callout"
2425
import Card from "@/components/Card"
2526
import EnergyConsumptionChart from "@/components/EnergyConsumptionChart"
2627
import FeedbackCard from "@/components/FeedbackCard"
2728
import { Image, type ImageProps } from "@/components/Image"
29+
import InlineLink from "@/components/Link"
2830
import MainArticle from "@/components/MainArticle"
2931
import PageMetadata from "@/components/PageMetadata"
3032
import { StandaloneQuizWidget } from "@/components/Quiz/QuizWidget"
@@ -46,9 +48,6 @@ import {
4648
getRequiredNamespacesForPage,
4749
} from "@/lib/utils/translations"
4850

49-
import InlineLink from "../../tailwind/Link"
50-
import { Button, ButtonLink } from "../../tailwind/ui/buttons/Button"
51-
5251
import { fetchTxCount } from "@/lib/api/fetchTxCount"
5352
import dogeComputerImg from "@/public/images/doge-computer.png"
5453
import ethImg from "@/public/images/eth.png"
@@ -653,10 +652,7 @@ const WhatIsEthereumPage = ({
653652
<ButtonLink href="/smart-contracts/">
654653
{t("page-what-is-ethereum-more-on-smart-contracts")}
655654
</ButtonLink>
656-
<ButtonLink
657-
href="/dapps/"
658-
buttonProps={{ isSecondary: true, variant: "outline" }}
659-
>
655+
<ButtonLink href="/dapps/" variant="outline" isSecondary>
660656
{t("page-what-is-ethereum-explore-dapps")}
661657
</ButtonLink>
662658
</ButtonRow>
@@ -679,10 +675,7 @@ const WhatIsEthereumPage = ({
679675
<ButtonLink href="/eth/">
680676
{t("page-what-is-ethereum-what-is-ether")}
681677
</ButtonLink>
682-
<ButtonLink
683-
href="/get-eth/"
684-
buttonProps={{ isSecondary: true, variant: "outline" }}
685-
>
678+
<ButtonLink href="/get-eth/" variant="outline" isSecondary>
686679
{t("page-what-is-ethereum-get-eth")}
687680
</ButtonLink>
688681
</ButtonRow>
@@ -711,7 +704,8 @@ const WhatIsEthereumPage = ({
711704
</ButtonLink>
712705
<ButtonLink
713706
href="/roadmap/merge/"
714-
buttonProps={{ isSecondary: true, variant: "outline" }}
707+
variant="outline"
708+
isSecondary
715709
>
716710
{t("page-what-is-ethereum-the-merge-update")}
717711
</ButtonLink>

tailwind/ui/buttons/Button.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,13 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
106106
)
107107
Button.displayName = "Button"
108108

109-
type ButtonLinkProps = LinkProps & {
110-
buttonProps?: ButtonProps
109+
type ButtonLinkProps = ButtonProps & {
110+
linkProps: LinkProps
111111
customEventOptions?: MatomoEventOptions
112112
}
113113

114114
const ButtonLink = React.forwardRef<HTMLAnchorElement, ButtonLinkProps>(
115-
({ buttonProps, customEventOptions, children, ...linkProps }, ref) => {
115+
({ linkProps, customEventOptions, children, ...buttonProps }, ref) => {
116116
const handleClick = () => {
117117
customEventOptions && trackCustomEvent(customEventOptions)
118118
}
@@ -123,7 +123,7 @@ const ButtonLink = React.forwardRef<HTMLAnchorElement, ButtonLinkProps>(
123123
activeStyle={{}}
124124
// TODO: Redress this override when migrating the link component
125125
color={
126-
buttonProps?.variant === "solid" ? "background.base" : undefined
126+
buttonProps.variant === "solid" ? "background.base" : undefined
127127
}
128128
textDecor="none"
129129
_hover={{

0 commit comments

Comments
 (0)