Skip to content

Commit 175d15c

Browse files
committed
fix: <img> usage; use NextImage, add domains to allow list
1 parent 1a54816 commit 175d15c

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

next.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ module.exports = (phase, { defaultConfig }) => {
8181
protocol: "https",
8282
hostname: "crowdin-static.downloads.crowdin.com",
8383
},
84+
{
85+
protocol: "https",
86+
hostname: "avatars.githubusercontent.com",
87+
},
88+
{
89+
protocol: "https",
90+
hostname: "coin-images.coingecko.com",
91+
},
8492
],
8593
},
8694
async headers() {

src/components/Contributors.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import { useEffect, useState } from "react"
44
import shuffle from "lodash/shuffle"
55

6+
import { Image } from "@/components/Image"
67
import { Flex } from "@/components/ui/flex"
78
import InlineLink from "@/components/ui/Link"
89
import { LinkBox, LinkOverlay } from "@/components/ui/link-box"
@@ -39,7 +40,7 @@ const Contributors = () => {
3940
className="m-2 max-w-[132px] transform shadow transition-transform duration-100 hover:scale-[1.02] hover:rounded hover:bg-background-highlight focus:scale-[1.02] focus:rounded"
4041
key={contributor.login}
4142
>
42-
<img
43+
<Image
4344
className="h-[132px] w-[132px]"
4445
src={contributor.avatar_url}
4546
alt={contributor.name}

src/components/EventCard.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ const EventCard: React.FC<EventCardProps> = ({
4545
</CardHeader>
4646
<div className="flex items-center justify-center">
4747
{imageUrl ? (
48+
// eslint-disable-next-line @next/next/no-img-element
4849
<img
4950
src={imageUrl}
5051
alt={title}

src/components/StablecoinsTable.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { cn } from "@/lib/utils/cn"
2+
13
import { ButtonLink } from "./ui/buttons/Button"
24
import { Flex } from "./ui/flex"
35
import {
@@ -8,6 +10,7 @@ import {
810
TableHeader,
911
TableRow,
1012
} from "./ui/table"
13+
import { Image } from "./Image"
1114

1215
import { useRtlFlip } from "@/hooks/useRtlFlip"
1316
import { useTranslation } from "@/hooks/useTranslation"
@@ -31,7 +34,7 @@ const StablecoinsTable = ({
3134
content,
3235
hasError,
3336
}: StablecoinsTableProps) => {
34-
const { flipForRtl } = useRtlFlip()
37+
const { twFlipForRtl } = useRtlFlip()
3538
const { t } = useTranslation("page-stablecoins")
3639

3740
const stablecoinsType = {
@@ -51,9 +54,7 @@ const StablecoinsTable = ({
5154

5255
{content && content[0]?.url && (
5356
<TableHead className="text-right font-normal">
54-
<span className="inline-block" style={{ transform: flipForRtl }}>
55-
56-
</span>
57+
<span className={cn("inline-block", twFlipForRtl)}></span>
5758
</TableHead>
5859
)}
5960
</TableRow>
@@ -71,7 +72,7 @@ const StablecoinsTable = ({
7172
<TableRow key={idx}>
7273
<TableCell>
7374
<Flex>
74-
{image && <img src={image} alt="" className="me-4 h-6 w-6" />}
75+
{image && <Image src={image} alt="" className="me-4 h-6 w-6" />}
7576
<>{name}</>
7677
</Flex>
7778
</TableCell>

0 commit comments

Comments
 (0)