Skip to content

Commit

Permalink
Merge pull request #535 from oraichain/fix/icon-pools
Browse files Browse the repository at this point in the history
fix: icon pools
  • Loading branch information
haunv3 authored Jan 9, 2024
2 parents d1ffc0f + 4f2491a commit e662fe5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/pages/Pools/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import isEqual from 'lodash/isEqual';
import { PoolInfoResponse } from 'types/pool';
import { Filter } from './components/Filter';
import { parseAssetOnlyDenom } from './helpers';
import { ReactComponent as DefaultIcon } from 'assets/icons/tokens.svg';
import {
useFetchCacheRewardAssetForAllPools,
useFetchLpPoolsV3,
Expand Down Expand Up @@ -111,10 +112,13 @@ const Pools: React.FC<{}> = () => {
});

const generateIcon = (baseToken: TokenItemType, quoteToken: TokenItemType): JSX.Element => {
const BaseTokenIcon = theme === 'light' ? baseToken.IconLight : baseToken.Icon;
const QuoteTokenIcon = theme === 'light' ? quoteToken.IconLight : quoteToken.Icon;
let [BaseTokenIcon, QuoteTokenIcon] = [DefaultIcon, DefaultIcon];

if (baseToken) BaseTokenIcon = theme === 'light' ? baseToken.IconLight : baseToken.Icon;
if (quoteToken) QuoteTokenIcon = theme === 'light' ? quoteToken.IconLight : quoteToken.Icon;

// TODO: hardcode reverse logo for ORAI/INJ, need to update later
if (baseToken.coinGeckoId === 'injective-protocol' && quoteToken.coinGeckoId === 'oraichain-token') {
if (baseToken?.coinGeckoId === 'injective-protocol' && quoteToken?.coinGeckoId === 'oraichain-token') {
return (
<div className={styles.symbols}>
<QuoteTokenIcon className={styles.symbols_logo_left} />
Expand Down

0 comments on commit e662fe5

Please sign in to comment.