Skip to content

Commit

Permalink
revert(pages/what-is-ethereum): revert import location for link, button
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerAPfledderer committed Aug 4, 2024
1 parent 0aa483a commit f7d2e87
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
18 changes: 6 additions & 12 deletions src/pages/what-is-ethereum.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ import {
BannerGridCell,
BannerImage,
} from "@/components/BannerGrid"
import { Button, ButtonLink } from "@/components/Buttons"
import Callout from "@/components/Callout"
import Card from "@/components/Card"
import EnergyConsumptionChart from "@/components/EnergyConsumptionChart"
import FeedbackCard from "@/components/FeedbackCard"
import { Image, type ImageProps } from "@/components/Image"
import InlineLink from "@/components/Link"
import MainArticle from "@/components/MainArticle"
import PageMetadata from "@/components/PageMetadata"
import { StandaloneQuizWidget } from "@/components/Quiz/QuizWidget"
Expand All @@ -46,9 +48,6 @@ import {
getRequiredNamespacesForPage,
} from "@/lib/utils/translations"

import InlineLink from "../../tailwind/Link"
import { Button, ButtonLink } from "../../tailwind/ui/buttons/Button"

import { fetchTxCount } from "@/lib/api/fetchTxCount"
import dogeComputerImg from "@/public/images/doge-computer.png"
import ethImg from "@/public/images/eth.png"
Expand Down Expand Up @@ -653,10 +652,7 @@ const WhatIsEthereumPage = ({
<ButtonLink href="/smart-contracts/">
{t("page-what-is-ethereum-more-on-smart-contracts")}
</ButtonLink>
<ButtonLink
href="/dapps/"
buttonProps={{ isSecondary: true, variant: "outline" }}
>
<ButtonLink href="/dapps/" variant="outline" isSecondary>
{t("page-what-is-ethereum-explore-dapps")}
</ButtonLink>
</ButtonRow>
Expand All @@ -679,10 +675,7 @@ const WhatIsEthereumPage = ({
<ButtonLink href="/eth/">
{t("page-what-is-ethereum-what-is-ether")}
</ButtonLink>
<ButtonLink
href="/get-eth/"
buttonProps={{ isSecondary: true, variant: "outline" }}
>
<ButtonLink href="/get-eth/" variant="outline" isSecondary>
{t("page-what-is-ethereum-get-eth")}
</ButtonLink>
</ButtonRow>
Expand Down Expand Up @@ -711,7 +704,8 @@ const WhatIsEthereumPage = ({
</ButtonLink>
<ButtonLink
href="/roadmap/merge/"
buttonProps={{ isSecondary: true, variant: "outline" }}
variant="outline"
isSecondary
>
{t("page-what-is-ethereum-the-merge-update")}
</ButtonLink>
Expand Down
8 changes: 4 additions & 4 deletions tailwind/ui/buttons/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
)
Button.displayName = "Button"

type ButtonLinkProps = LinkProps & {
buttonProps?: ButtonProps
type ButtonLinkProps = ButtonProps & {
linkProps: LinkProps
customEventOptions?: MatomoEventOptions
}

const ButtonLink = React.forwardRef<HTMLAnchorElement, ButtonLinkProps>(
({ buttonProps, customEventOptions, children, ...linkProps }, ref) => {
({ linkProps, customEventOptions, children, ...buttonProps }, ref) => {
const handleClick = () => {
customEventOptions && trackCustomEvent(customEventOptions)
}
Expand All @@ -123,7 +123,7 @@ const ButtonLink = React.forwardRef<HTMLAnchorElement, ButtonLinkProps>(
activeStyle={{}}
// TODO: Redress this override when migrating the link component
color={
buttonProps?.variant === "solid" ? "background.base" : undefined
buttonProps.variant === "solid" ? "background.base" : undefined
}
textDecor="none"
_hover={{
Expand Down

0 comments on commit f7d2e87

Please sign in to comment.