Skip to content

Commit d02ed0b

Browse files
authored
Merge pull request #10470 from ethereum/migrate-eth-page
Migrate `eth` page
2 parents e82d1d1 + 9bb1315 commit d02ed0b

File tree

4 files changed

+306
-214
lines changed

4 files changed

+306
-214
lines changed

src/components/ActionCard.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
LinkOverlay,
1010
Image,
1111
useColorModeValue,
12+
LinkBoxProps,
1213
} from "@chakra-ui/react"
1314
import { GatsbyImage, IGatsbyImageData } from "gatsby-plugin-image"
1415

@@ -26,7 +27,7 @@ const linkFocusStyles: BoxProps = {
2627
textDecoration: "none",
2728
}
2829

29-
export interface IProps {
30+
export interface IProps extends Omit<LinkBoxProps, "title"> {
3031
children?: React.ReactNode
3132
to: string
3233
alt?: string
@@ -48,6 +49,7 @@ const ActionCard: React.FC<IProps> = ({
4849
className,
4950
isRight,
5051
isBottom = true,
52+
...rest
5153
}) => {
5254
const isImageURL = typeof image === "string"
5355
const descriptionColor = useColorModeValue("blackAlpha.700", "whiteAlpha.800")
@@ -63,6 +65,7 @@ const ActionCard: React.FC<IProps> = ({
6365
_focus={linkBoxFocusStyles}
6466
className={className}
6567
m={4}
68+
{...rest}
6669
>
6770
<Flex
6871
minH="260px"

src/components/EthPriceCard.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
import React, { useState, useEffect } from "react"
2-
import { Box, Flex, Heading, Icon } from "@chakra-ui/react"
2+
import { Box, Flex, FlexProps, Heading, Icon } from "@chakra-ui/react"
33
import { MdInfoOutline } from "react-icons/md"
44
import axios from "axios"
55

66
import Translation from "./Translation"
77
import Link from "./Link"
88
import Tooltip from "./Tooltip"
99

10-
export interface IProps {
11-
className?: string
10+
export interface IProps extends FlexProps {
1211
isLeftAlign?: boolean
1312
}
1413

1514
// TODO add prop to left vs. center align
16-
const EthPriceCard: React.FC<IProps> = ({ className, isLeftAlign = false }) => {
15+
const EthPriceCard: React.FC<IProps> = ({ isLeftAlign = false, ...rest }) => {
1716
const [state, setState] = useState({
1817
currentPriceUSD: "",
1918
percentChangeUSD: 0,
@@ -75,7 +74,6 @@ const EthPriceCard: React.FC<IProps> = ({ className, isLeftAlign = false }) => {
7574

7675
return (
7776
<Flex
78-
className={className}
7977
direction="column"
8078
align={isLeftAlign ? "flex-start" : "center"}
8179
justify="space-between"
@@ -93,6 +91,7 @@ const EthPriceCard: React.FC<IProps> = ({ className, isLeftAlign = false }) => {
9391
maxW="420px"
9492
maxH="192px"
9593
borderRadius="base"
94+
{...rest}
9695
>
9796
<Heading
9897
as="h4"

src/components/HorizontalCard.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import React, { ReactNode } from "react"
22
import Emoji from "./Emoji"
33
import { Text, Box, Flex, FlexProps } from "@chakra-ui/react"
44

5-
export interface IProps extends FlexProps {
5+
export interface IProps extends Omit<FlexProps, "title"> {
66
emoji: string
7+
title: ReactNode
78
description: ReactNode
8-
className?: string
99
emojiSize?: number
1010
}
1111

@@ -14,11 +14,10 @@ const HorizontalCard: React.FC<IProps> = ({
1414
title,
1515
description,
1616
children,
17-
className,
1817
emojiSize,
1918
...rest
2019
}) => (
21-
<Flex borderRadius="base" className={className} {...rest}>
20+
<Flex borderRadius="base" {...rest}>
2221
<Emoji fontSize={`${emojiSize}rem`} text={emoji} />
2322
<Box flexGrow="0" flexShrink="1" flexBasis="75%" ml="8">
2423
<Text fontSize="lg">{title}</Text>

0 commit comments

Comments
 (0)