Skip to content

Commit

Permalink
Bean UI - Tweaked defaults (#633)
Browse files Browse the repository at this point in the history
  • Loading branch information
hellofromguy authored Sep 11, 2023
2 parents 8d486de + cf42fde commit 77ab278
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions projects/ui/src/components/Silo/Actions/Deposit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,34 @@ const DepositPropProvider: FC<{
tokens.USDT,
];
}, [sdk.tokens, whitelistedToken]);

const priorityList = useMemo(() => {
const tokens = sdk.tokens;
if (tokens.BEAN.equals(whitelistedToken)) {
return [
tokens.BEAN,
tokens.ETH,
tokens.WETH,
tokens.CRV3,
tokens.DAI,
tokens.USDC,
tokens.USDT,
];
}
return [
whitelistedToken,
tokens.ETH,
tokens.WETH,
tokens.BEAN,
tokens.CRV3,
tokens.DAI,
tokens.USDC,
tokens.USDT,
];
}, [sdk.tokens, whitelistedToken]);

const allAvailableTokens = useTokenMap(initTokenList);
const priorityListTokens = useTokenMap(priorityList);

/// Token List
const [tokenList, preferredTokens] = useMemo(() => {
Expand All @@ -361,8 +388,9 @@ const DepositPropProvider: FC<{
}

const _tokenList = Object.values(allAvailableTokens);
return [_tokenList, _tokenList.map((t) => ({ token: t }))];
}, [whitelistedToken, allAvailableTokens]);
const _priorityList = Object.values(priorityListTokens);
return [_tokenList, _priorityList.map((t) => ({ token: t }))];
}, [whitelistedToken, allAvailableTokens, priorityListTokens]);

const baseToken = usePreferredToken(preferredTokens, 'use-best') as
| ERC20Token
Expand Down

0 comments on commit 77ab278

Please sign in to comment.