mirror of
https://github.com/kremalicious/asi-calculator.git
synced 2024-12-22 01:13:17 +01:00
static & manually optimized token logos
This commit is contained in:
parent
26f68e478f
commit
b3fbdff342
@ -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
BIN
images/agix.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
BIN
images/fet.png
Normal file
BIN
images/fet.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
BIN
images/ocean.png
Normal file
BIN
images/ocean.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
Loading…
Reference in New Issue
Block a user