mirror of
https://github.com/kremalicious/asi-calculator.git
synced 2024-12-22 09:23:16 +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 { 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
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