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