@@ -3,13 +3,18 @@ import Fuse from "fuse.js";
33import React , { useMemo } from "react" ;
44
55import { AssetIconCard } from "@/components/AssetIconCard" ;
6+ import { BrandIconCard } from "@/components/BrandIconCard" ;
67import { Branding } from "@/components/Branding" ;
78import { ChainIconCard } from "@/components/ChainIconCard" ;
89import { Search } from "@/components/Search" ;
910import { WalletIconCard } from "@/components/WalletIconCard" ;
1011
1112import icons from "../../../../../icons/icons.json" ;
12- import { IconInfo , IconType } from "../../../../../src/scripts/types" ;
13+ import {
14+ IconFormat ,
15+ IconInfo ,
16+ IconType ,
17+ } from "../../../../../src/scripts/types" ;
1318
1419async function IconsPage ( {
1520 searchParams,
@@ -23,7 +28,7 @@ async function IconsPage({
2328 const filteredIcons = useMemo (
2429 ( ) =>
2530 new Fuse ( icons as IconInfo [ ] , {
26- keys : [ "chainId" , "symbol" , "identityFlag" , "walletName" ] ,
31+ keys : [ "chainId" , "symbol" , "identityFlag" , "walletName" , "brandName" ] ,
2732 threshold : 0.3 ,
2833 distance : 1000 ,
2934 } )
@@ -42,16 +47,16 @@ async function IconsPage({
4247 . map ( ( item ) => {
4348 const asset = item ;
4449 if ( asset . type . includes ( IconType . asset ) ) {
45- if ( asset . icons . aToken && ! asset . icons . stataToken ) {
46- return (
47- < React . Fragment key = { asset ?. symbol ?? asset ?. chainId } >
48- < AssetIconCard
49- name = { asset . name ?? "" }
50- symbol = { asset ?. symbol ?? "" }
51- chainId = { asset . chainId }
52- chainName = { asset . chainName }
53- icons = { asset . icons }
54- />
50+ return (
51+ < React . Fragment key = { asset ?. symbol ?? asset ?. chainId } >
52+ < AssetIconCard
53+ name = { asset . name ?? "" }
54+ symbol = { asset ?. symbol ?? "" }
55+ chainId = { asset . chainId }
56+ chainName = { asset . chainName }
57+ icons = { asset . icons }
58+ />
59+ { asset . icons [ IconFormat . aToken ] && (
5560 < AssetIconCard
5661 name = { asset . name ?? "" }
5762 symbol = { asset ?. symbol ?? "" }
@@ -60,18 +65,8 @@ async function IconsPage({
6065 icons = { asset . icons }
6166 assetTag = { AssetTag . AToken }
6267 />
63- </ React . Fragment >
64- ) ;
65- } else if ( ! asset . icons . aToken && asset . icons . stataToken ) {
66- return (
67- < React . Fragment key = { asset ?. symbol ?? asset ?. chainId } >
68- < AssetIconCard
69- name = { asset . name ?? "" }
70- symbol = { asset ?. symbol ?? "" }
71- chainId = { asset . chainId }
72- chainName = { asset . chainName }
73- icons = { asset . icons }
74- />
68+ ) }
69+ { asset . icons [ IconFormat . stataToken ] && (
7570 < AssetIconCard
7671 name = { asset . name ?? "" }
7772 symbol = { asset ?. symbol ?? "" }
@@ -80,48 +75,19 @@ async function IconsPage({
8075 icons = { asset . icons }
8176 assetTag = { AssetTag . StataToken }
8277 />
83- </ React . Fragment >
84- ) ;
85- } else if ( asset . icons . aToken && asset . icons . stataToken ) {
86- return (
87- < React . Fragment key = { asset ?. symbol ?? asset ?. chainId } >
88- < AssetIconCard
89- name = { asset . name ?? "" }
90- symbol = { asset ?. symbol ?? "" }
91- chainId = { asset . chainId }
92- chainName = { asset . chainName }
93- icons = { asset . icons }
94- />
78+ ) }
79+ { asset . icons [ IconFormat . stkToken ] && (
9580 < AssetIconCard
9681 name = { asset . name ?? "" }
9782 symbol = { asset ?. symbol ?? "" }
9883 chainId = { asset . chainId }
9984 chainName = { asset . chainName }
10085 icons = { asset . icons }
101- assetTag = { AssetTag . AToken }
102- />
103- < AssetIconCard
104- name = { asset . name ?? "" }
105- symbol = { asset ?. symbol ?? "" }
106- chainId = { asset . chainId }
107- chainName = { asset . chainName }
108- icons = { asset . icons }
109- assetTag = { AssetTag . StataToken }
86+ assetTag = { AssetTag . STKToken }
11087 />
111- </ React . Fragment >
112- ) ;
113- } else {
114- return (
115- < AssetIconCard
116- key = { asset ?. symbol ?? asset ?. chainId }
117- name = { asset . name ?? "" }
118- symbol = { asset ?. symbol ?? "" }
119- chainId = { asset . chainId }
120- chainName = { asset . chainName }
121- icons = { asset . icons }
122- />
123- ) ;
124- }
88+ ) }
89+ </ React . Fragment >
90+ ) ;
12591 } else if ( asset . type . includes ( IconType . chain ) ) {
12692 return (
12793 < ChainIconCard
@@ -138,6 +104,13 @@ async function IconsPage({
138104 name = { asset ?. walletName ?? "Unknown" }
139105 />
140106 ) ;
107+ } else if ( asset . type . includes ( IconType . brand ) ) {
108+ return (
109+ < BrandIconCard
110+ icons = { asset . icons }
111+ name = { asset ?. brandName ?? "Unknown" }
112+ />
113+ ) ;
141114 }
142115 } ) }
143116 { ! filteredIcons . length && searchString !== "" && (
0 commit comments