Skip to content

Commit c24d0cd

Browse files
authored
Merge branch 'dev' into what-is-ethereum-stats
2 parents d2d2441 + aac0b3c commit c24d0cd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+975
-377
lines changed

src/components/CalloutBanner.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import Text from "@/components/OldText"
1010
export type CalloutBannerProps = FlexProps & {
1111
children?: React.ReactNode
1212
image: ImageProps["src"]
13-
imageWidth?: ImageProps["width"]
14-
maxImageWidth?: number
13+
imageWidth?: number
14+
maxImageWidth?: ImageProps["width"]
1515
titleKey: TranslationKey
1616
descriptionKey: TranslationKey
1717
alt: string
@@ -43,7 +43,8 @@ const CalloutBanner = ({
4343
<Image
4444
src={image}
4545
alt={alt}
46-
w={imageWidth}
46+
width={imageWidth}
47+
maxW={{ base: "auto", md: maxImageWidth }}
4748
style={{
4849
objectFit: "contain",
4950
}}

src/components/CardList.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export type CardListItem = {
2424
link?: string
2525
id?: string
2626
image?: ImageProps["src"]
27+
imageWidth?: number
2728
alt?: string
2829
}
2930

@@ -51,6 +52,7 @@ const Card = ({
5152
caption,
5253
link,
5354
image,
55+
imageWidth = 20, // Set 20px as default image width, can be overrided if needed
5456
alt,
5557
...props
5658
}: CardProps) => {
@@ -62,7 +64,7 @@ const Card = ({
6264

6365
return (
6466
<CardContainer {...props}>
65-
{image && <Image src={image} alt={alt ?? ""} width={20} />}
67+
{image && <Image src={image} alt={alt ?? ""} width={imageWidth} />}
6668
<Flex flex="1 1 75%" direction="column">
6769
{isLink ? (
6870
<LinkOverlay
@@ -97,11 +99,13 @@ const Card = ({
9799

98100
export type CardListProps = BoxProps & {
99101
items: CardProps[]
102+
imageWidth?: number
100103
clickHandler?: (idx: string | number) => void
101104
}
102105

103106
const CardList = ({
104107
items,
108+
imageWidth,
105109
clickHandler = () => null,
106110
...props
107111
}: CardListProps) => (
@@ -112,7 +116,7 @@ const CardList = ({
112116

113117
return isLink ? (
114118
<LinkBox key={id || idx}>
115-
<Card {...listItem} />
119+
<Card {...listItem} imageWidth={imageWidth} />
116120
</LinkBox>
117121
) : (
118122
<Card

src/components/DataProductCard.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react"
2-
import { IGatsbyImageData } from "gatsby-plugin-image"
2+
import { StaticImageData } from "next/image"
33
import {
44
Box,
55
Flex,
@@ -9,19 +9,21 @@ import {
99
useColorModeValue,
1010
} from "@chakra-ui/react"
1111

12-
import GatsbyImage from "./GatsbyImage"
12+
import { Image } from "@/components/Image"
13+
1314
import Text from "./OldText"
1415

1516
export interface DataRow {
16-
logo: IGatsbyImageData
17+
logo: StaticImageData
1718
coin: string
1819
apy: string
1920
}
2021

2122
export interface IProps {
2223
url: string
2324
background: string
24-
image: IGatsbyImageData
25+
image: StaticImageData
26+
imgWidth: string
2527
alt?: string
2628
name: string
2729
description?: string
@@ -32,6 +34,7 @@ const DataProductCard: React.FC<IProps> = ({
3234
url,
3335
background,
3436
image,
37+
imgWidth,
3538
alt,
3639
name,
3740
description,
@@ -64,11 +67,11 @@ const DataProductCard: React.FC<IProps> = ({
6467
minH="200px"
6568
bg={background}
6669
>
67-
<GatsbyImage
68-
image={image}
70+
<Image
71+
src={image}
6972
objectFit="cover"
7073
alt={alt ? alt : `${name} logo`}
71-
width="100%"
74+
w={imgWidth}
7275
alignSelf="center"
7376
maxWidth={{ base: "311px", sm: "372px" }}
7477
maxHeight="257px"
@@ -121,8 +124,8 @@ const DataProductCard: React.FC<IProps> = ({
121124
>
122125
<Flex alignItems="center">
123126
{logo && (
124-
<GatsbyImage
125-
image={logo}
127+
<Image
128+
src={logo}
126129
objectFit="cover"
127130
alt=""
128131
minWidth="24px"

src/components/StablecoinAccordion/AccordionCustomItem.tsx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import React, { ReactNode } from "react"
1+
import { ReactNode } from "react"
2+
import { useTranslation } from "next-i18next"
23
import {
34
AccordionButton,
45
AccordionItem,
@@ -12,7 +13,6 @@ import {
1213

1314
import Emoji from "../Emoji"
1415
import Pill from "../Pill"
15-
import Translation from "../Translation"
1616

1717
import { accordionButtonContent, CategoryNameType } from "./utils"
1818
import { ChildOnlyType } from "."
@@ -26,13 +26,13 @@ export const RightColumnPanel = (props: ChildOnlyType) => (
2626
)
2727

2828
const MoreOrLessLink = ({ isOpen }: { isOpen: boolean }) => {
29+
const { t } = useTranslation("page-stablecoins")
30+
2931
return (
3032
<Box me={6} color="primary.base">
31-
{isOpen ? (
32-
<Translation id="page-stablecoins-accordion-less" />
33-
) : (
34-
<Translation id="page-stablecoins-accordion-more" />
35-
)}
33+
{isOpen
34+
? t("page-stablecoins-accordion-less")
35+
: t("page-stablecoins-accordion-more")}
3636
</Box>
3737
)
3838
}
@@ -47,6 +47,7 @@ interface AccordionCustomItemProps {
4747

4848
export const AccordionCustomItem = (props: AccordionCustomItemProps) => {
4949
const { category, children } = props
50+
const { t } = useTranslation("page-stablecoins")
5051

5152
const contentObj = accordionButtonContent[category]
5253

@@ -80,16 +81,16 @@ export const AccordionCustomItem = (props: AccordionCustomItemProps) => {
8081
fontSize={{ base: "1.25rem", md: "1.5rem" }}
8182
lineHeight={1.4}
8283
>
83-
<Translation id={contentObj.title} />
84+
{t(contentObj.title)}
8485
</Heading>
8586
{!!contentObj.pill && (
8687
<Pill ms={4} background={contentObj.pill.color}>
87-
<Translation id={contentObj.pill.name} />
88+
{t(contentObj.pill.name)}
8889
</Pill>
8990
)}
9091
</Flex>
9192
<Text color="text200" textAlign="start">
92-
<Translation id={contentObj.textPreview} />
93+
{t(contentObj.textPreview)}
9394
</Text>
9495
</Box>
9596
</Flex>

0 commit comments

Comments
 (0)