Skip to content

Commit 77febed

Browse files
refactor(components): replace and remove old image component
1 parent 9fde412 commit 77febed

Some content is hidden

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

51 files changed

+144
-206
lines changed

src/components/ActionCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { StaticImageData } from "next/image"
22
import type { BaseHTMLAttributes, ElementType, ReactNode } from "react"
33

4-
import { TwImage } from "@/components/Image"
4+
import { Image } from "@/components/Image"
55
import InlineLink from "@/components/ui/Link"
66
import { LinkBox, LinkOverlay } from "@/components/ui/link-box"
77

@@ -53,7 +53,7 @@ const ActionCard = ({
5353
isRight ? "justify-end" : "justify-center"
5454
)}
5555
>
56-
<TwImage
56+
<Image
5757
src={image}
5858
alt={alt || ""}
5959
width={imageWidth}

src/components/AssetDownload/AssetDownloadImage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ImageProps } from "next/image"
22

3-
import { TwImage } from "../Image"
3+
import { Image } from "../Image"
44
import { Center } from "../ui/flex"
55

66
interface AssetDownloadImageProps {
@@ -10,7 +10,7 @@ interface AssetDownloadImageProps {
1010

1111
const AssetDownloadImage = ({ image, alt }: AssetDownloadImageProps) => (
1212
<Center className="w-full border p-8">
13-
<TwImage src={image} alt={alt} className="w-full self-center" />
13+
<Image src={image} alt={alt} className="w-full self-center" />
1414
</Center>
1515
)
1616

src/components/Banners/ContributorsQuizBanner.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { cn } from "@/lib/utils/cn"
22

3-
import { TwImage } from "../Image"
3+
import { Image } from "../Image"
44
import { ButtonLink } from "../ui/buttons/Button"
55
import { Flex, Stack } from "../ui/flex"
66

@@ -29,7 +29,7 @@ function ContributorsQuizBanner({
2929
"px-8 md:px-0"
3030
)}
3131
>
32-
<TwImage
32+
<Image
3333
className="absolute max-h-[120%] w-full object-contain"
3434
src={PeopleLearning}
3535
alt="People learning about Ethereum"

src/components/Callout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useTranslation } from "next-i18next"
33
import type { TranslationKey } from "@/lib/types"
44

55
import Emoji from "@/components/Emoji"
6-
import { type ImageProps, TwImage } from "@/components/Image"
6+
import { Image, type ImageProps } from "@/components/Image"
77

88
import { cn } from "@/lib/utils/cn"
99

@@ -43,7 +43,7 @@ const Callout = ({
4343
>
4444
{image && (
4545
<div className="-mt-40 self-center">
46-
<TwImage
46+
<Image
4747
src={image}
4848
alt={alt || ""}
4949
className="max-h-[263px] min-h-[200px] max-w-[263px] object-contain"

src/components/CalloutBanner.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useTranslation } from "next-i18next"
22

33
import type { TranslationKey } from "@/lib/types"
44

5-
import { type ImageProps, TwImage } from "@/components/Image"
5+
import { Image, type ImageProps } from "@/components/Image"
66

77
import { cn } from "@/lib/utils/cn"
88

@@ -36,7 +36,7 @@ const CalloutBanner = ({
3636
{...props}
3737
>
3838
<div className="flex">
39-
<TwImage
39+
<Image
4040
src={image}
4141
alt={alt}
4242
width={imageWidth}

src/components/DataProductCard.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react"
22
import { StaticImageData } from "next/image"
33

4-
import { TwImage } from "@/components/Image"
4+
import { Image } from "@/components/Image"
55
import { Flex } from "@/components/ui/flex"
66

77
import InlineLink from "./ui/Link"
@@ -42,7 +42,7 @@ const DataProductCard = ({
4242
}
4343
style={{ background }}
4444
>
45-
<TwImage
45+
<Image
4646
alt={alt ? alt : `${name} logo`}
4747
className="max-h-[257px] max-w-[311px] self-center object-cover sm:max-w-[372px]"
4848
src={image}
@@ -69,7 +69,7 @@ const DataProductCard = ({
6969
>
7070
<Flex className="items-center">
7171
{logo && (
72-
<TwImage
72+
<Image
7373
className="me-2 min-w-6 object-cover"
7474
src={logo}
7575
alt=""

src/components/EventCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { Card, CardContent, CardFooter, CardHeader } from "@/components/ui/card"
1010

1111
import { cn } from "@/lib/utils/cn"
1212

13-
import { TwImage } from "./Image"
13+
import { Image } from "./Image"
1414

1515
import EventFallback from "@/public/images/events/event-placeholder.png"
1616

@@ -55,7 +55,7 @@ const EventCard: React.FC<EventCardProps> = ({
5555
className="max-h-[224px] w-full object-cover xl:h-[124px]"
5656
/>
5757
) : (
58-
<TwImage src={EventFallback} alt="" />
58+
<Image src={EventFallback} alt="" />
5959
)}
6060
</div>
6161
<CardContent className="flex-grow p-4">

src/components/FindWalletProductTable/WalletInfo.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Wallet } from "@/lib/types"
55

66
import { SupportedLanguagesTooltip } from "@/components/FindWalletProductTable/SupportedLanguagesTooltip"
77
import { DevicesIcon, LanguagesIcon } from "@/components/icons/wallets"
8-
import { TwImage } from "@/components/Image"
8+
import { Image } from "@/components/Image"
99
import Tooltip from "@/components/Tooltip"
1010
import { Tag } from "@/components/ui/tag"
1111

@@ -39,7 +39,7 @@ const WalletInfo = ({ wallet, isExpanded }: WalletInfoProps) => {
3939
<div className="flex flex-row items-center justify-between gap-4">
4040
<div className="flex flex-col gap-4">
4141
<div className="hidden flex-row gap-4 lg:flex">
42-
<TwImage
42+
<Image
4343
src={wallet.image}
4444
alt=""
4545
style={{ objectFit: "contain", width: "56px", height: "56px" }}
@@ -70,7 +70,7 @@ const WalletInfo = ({ wallet, isExpanded }: WalletInfoProps) => {
7070
className="-ml-1.5 overflow-hidden rounded-full"
7171
>
7272
<Tooltip content={chainData?.name || ""}>
73-
<TwImage
73+
<Image
7474
src={chainData?.logo || ""}
7575
alt=""
7676
className="rounded-full"
@@ -89,7 +89,7 @@ const WalletInfo = ({ wallet, isExpanded }: WalletInfoProps) => {
8989
</div>
9090
<div className="flex flex-col gap-4 lg:hidden">
9191
<div className="flex flex-row items-center gap-4">
92-
<TwImage
92+
<Image
9393
src={wallet.image}
9494
alt=""
9595
style={{ objectFit: "contain", width: "24px", height: "24px" }}
@@ -122,7 +122,7 @@ const WalletInfo = ({ wallet, isExpanded }: WalletInfoProps) => {
122122
className="-ml-1.5 overflow-hidden rounded-full"
123123
>
124124
<Tooltip content={chainData?.name || ""}>
125-
<TwImage
125+
<Image
126126
src={chainData?.logo || ""}
127127
alt=""
128128
className="rounded-full"

src/components/Hero/ContentHero/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { CommonHeroProps } from "@/lib/types"
22

33
import Breadcrumbs from "@/components/Breadcrumbs"
4-
import { TwImage } from "@/components/Image"
4+
import { Image } from "@/components/Image"
55
import { Stack } from "@/components/ui/flex"
66

77
import { CallToAction } from "../CallToAction"
@@ -15,7 +15,7 @@ const ContentHero = (props: ContentHeroProps) => {
1515
<div className="bg-gradient-main">
1616
<div className="mx-auto grid max-w-screen-2xl grid-cols-1 items-center lg:grid-cols-2">
1717
<div className="h-[300px] md:h-[400px] lg:order-1 lg:h-full">
18-
<TwImage
18+
<Image
1919
className="box h-full max-h-[451px] w-full flex-auto object-contain md:flex-none"
2020
src={heroImg}
2121
alt=""

src/components/Hero/HomeHero/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useTranslation } from "next-i18next"
22

33
import type { ClassNameProp, CommonHeroProps } from "@/lib/types"
44

5-
import { TwImage } from "@/components/Image"
5+
import { Image } from "@/components/Image"
66
import Morpher from "@/components/Morpher"
77

88
export type HomeHeroProps = Pick<CommonHeroProps, "heroImg"> & ClassNameProp
@@ -13,7 +13,7 @@ const HomeHero = ({ heroImg, className }: HomeHeroProps) => {
1313
return (
1414
<div className={className}>
1515
<div className="h-[240px] md:h-[380px] lg:h-[480px]">
16-
<TwImage
16+
<Image
1717
src={heroImg}
1818
alt={t("page-index:page-index-hero-image-alt")}
1919
// TODO: adjust value when the old theme breakpoints are removed (src/theme.ts)

0 commit comments

Comments
 (0)