Commit 2ca15261 authored by tom's avatar tom

small fixes

parent aa81d368
...@@ -77,6 +77,9 @@ const variantOutline = defineStyle((props) => { ...@@ -77,6 +77,9 @@ const variantOutline = defineStyle((props) => {
bg: props.isActive ? activeBg : 'transparent', bg: props.isActive ? activeBg : 'transparent',
borderColor: props.isActive ? activeBg : 'blue.400', borderColor: props.isActive ? activeBg : 'blue.400',
color: props.isActive ? activeColor : 'blue.400', color: props.isActive ? activeColor : 'blue.400',
p: {
color: 'blue.400',
},
}, },
_disabled: { _disabled: {
color, color,
......
...@@ -28,7 +28,7 @@ const TokenSelectButton = ({ isOpen, onClick, data }: Props, ref: React.Forwarde ...@@ -28,7 +28,7 @@ const TokenSelectButton = ({ isOpen, onClick, data }: Props, ref: React.Forwarde
<Icon as={ tokensIcon } boxSize={ 4 } mr={ 2 }/> <Icon as={ tokensIcon } boxSize={ 4 } mr={ 2 }/>
<Text fontWeight={ 600 }>{ data.length }</Text> <Text fontWeight={ 600 }>{ data.length }</Text>
<Text whiteSpace="pre" variant="secondary" fontWeight={ 400 }> (${ totalBn.toFormat(2) })</Text> <Text whiteSpace="pre" variant="secondary" fontWeight={ 400 }> (${ totalBn.toFormat(2) })</Text>
<Icon as={ arrowIcon } transform={ isOpen ? 'rotate(90deg)' : 'rotate(-90deg)' } transitionDuration="normal" boxSize={ 5 } ml={ 3 }/> <Icon as={ arrowIcon } transform={ isOpen ? 'rotate(90deg)' : 'rotate(-90deg)' } transitionDuration="faster" boxSize={ 5 } ml={ 3 }/>
</Button> </Button>
); );
}; };
......
...@@ -10,7 +10,7 @@ import searchIcon from 'icons/search.svg'; ...@@ -10,7 +10,7 @@ import searchIcon from 'icons/search.svg';
import TokenSelectItem from './TokenSelectItem'; import TokenSelectItem from './TokenSelectItem';
import type { Sort, EnhancedData } from './utils'; import type { Sort, EnhancedData } from './utils';
import { SORTABLE_TOKENS, sortTokenGroups, sortingFns } from './utils'; import { sortTokenGroups, sortingFns } from './utils';
interface Props { interface Props {
searchTerm: string; searchTerm: string;
...@@ -56,14 +56,15 @@ const TokenSelectMenu = ({ erc20sort, erc1155sort, modifiedData, groupedData, on ...@@ -56,14 +56,15 @@ const TokenSelectMenu = ({ erc20sort, erc1155sort, modifiedData, groupedData, on
return 'desc'; return 'desc';
} }
})(); })();
const hasSort = type === 'ERC-1155' || (type === 'ERC-20' && tokenInfo.some(({ usd }) => usd));
return ( return (
<Box key={ type }> <Box key={ type }>
<Flex justifyContent="space-between"> <Flex justifyContent="space-between">
<Text mb={ 3 } color="gray.500" fontWeight={ 600 } fontSize="sm">{ type } tokens ({ tokenInfo.length })</Text> <Text mb={ 3 } color="gray.500" fontWeight={ 600 } fontSize="sm">{ type } tokens ({ tokenInfo.length })</Text>
{ SORTABLE_TOKENS.includes(type) && ( { hasSort && (
<Link data-type={ type } onClick={ onSortClick }> <Link data-type={ type } onClick={ onSortClick }>
<Icon as={ arrowIcon } boxSize={ 5 } transform={ arrowTransform } transitionDuration="fast"/> <Icon as={ arrowIcon } boxSize={ 5 } transform={ arrowTransform } transitionDuration="faster"/>
</Link> </Link>
) } ) }
</Flex> </Flex>
......
...@@ -8,7 +8,6 @@ export type EnhancedData = AddressTokenBalance & { ...@@ -8,7 +8,6 @@ export type EnhancedData = AddressTokenBalance & {
} }
export type Sort = 'desc' | 'asc'; export type Sort = 'desc' | 'asc';
export const SORTABLE_TOKENS: Array<TokenType> = [ 'ERC-20', 'ERC-1155' ];
const TOKEN_GROUPS_ORDER: Array<TokenType> = [ 'ERC-20', 'ERC-721', 'ERC-1155' ]; const TOKEN_GROUPS_ORDER: Array<TokenType> = [ 'ERC-20', 'ERC-721', 'ERC-1155' ];
type TokenGroup = [string, Array<AddressTokenBalance>]; type TokenGroup = [string, Array<AddressTokenBalance>];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment