static & manually optimized token logos

This commit is contained in:
Matthias Kretschmann 2024-05-05 14:17:37 +01:00
parent 26f68e478f
commit b3fbdff342
Signed by: m
GPG Key ID: 606EEEF3C479A91F
4 changed files with 14 additions and 4 deletions

View File

@ -1,6 +1,8 @@
import { Token } from '@/types' import { Token } from '@/types'
import Image from 'next/image'
import styles from './TokenLogo.module.css' import styles from './TokenLogo.module.css'
import oceanImage from '@/images/ocean.png'
import agixImage from '@/images/agix.png'
import fetImage from '@/images/fet.png'
export function TokenLogo({ export function TokenLogo({
token, token,
@ -9,13 +11,21 @@ export function TokenLogo({
token: Token | undefined token: Token | undefined
size?: number size?: number
}) { }) {
const imageSrc =
token?.symbol === 'OCEAN'
? oceanImage
: token?.symbol === 'AGIX'
? agixImage
: fetImage
return token ? ( return token ? (
<span className={styles.logo} data-symbol={token.symbol}> <span className={styles.logo} data-symbol={token.symbol}>
<Image {/* eslint-disable-next-line @next/next/no-img-element */}
src={`https://tokens.1inch.io/${token.address}.png`} <img
src={imageSrc.src}
width={size} width={size}
height={size} height={size}
alt={token.symbol} alt={`${token.symbol} Logo`}
/> />
</span> </span>
) : null ) : null

BIN
images/agix.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
images/fet.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
images/ocean.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB