Skip to content

Commit

Permalink
added hardcoded icons
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabricevladimir committed Oct 8, 2021
1 parent 9f8b26a commit 3a53356
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useFormContext } from 'react-hook-form';
import { useCallback, useMemo, useState } from 'react';
import { ButtonText, IconLeft, IconPlus, TextInput, GU } from '@aragon/ui';

import ETHIcon from 'images/pngs/eth_logo.png';
import { ETH } from 'utils/Asset';
import TokenCard from './TokenCard';
import TokenNotFound from './TokenNotFound';
Expand Down Expand Up @@ -95,10 +96,12 @@ const SelectToken: React.FC<Props> = ({ onTokenSelected }) => {

const handleAddToken = () => {
setValue('isCustomToken', true);

// TODO: find appropriate logo
setValue('token', {
symbol: query,
address: null,
logo: 'https://cryptologos.cc/logos/aragon-ant-logo.png',
logo: ETHIcon,
});
gotoState('initial');
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import styled from 'styled-components';

import ETHIcon from 'images/pngs/eth_logo.png';
import { ASSET_ICON_BASE_URL } from 'utils/constants';
import { getTruncatedAccountAddress } from 'utils/account';

const logoAddresses: any = {
DAI: '0x6B175474E89094C44Da98b954EedeAC495271d0F',
USDT: '0xdAC17F958D2ee523a2206206994597C13D831ec7',
USDC: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
};

type Props = {
key: string;
symbol: string;
Expand Down Expand Up @@ -50,7 +58,9 @@ const TokenLogo = styled.img`
`;

const TokenCard: React.FC<Props> = ({ symbol, address, onClick }) => {
const logo = 'https://cryptologos.cc/logos/aragon-ant-logo.png';
const logo =
symbol === 'ETH' ? ETHIcon : `${ASSET_ICON_BASE_URL}/${logoAddresses[symbol]}/logo.png`;

return (
<TokenCardContainer onClick={() => onClick({ symbol, address, logo })}>
<InfoContainer>
Expand Down

0 comments on commit 3a53356

Please sign in to comment.