Skip to content

Commit

Permalink
fix: final
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsimao committed Feb 16, 2023
1 parent 1605e56 commit 2ddf391
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions src/component-library/TokenInput/TokenInputBalance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,23 @@ const TokenInputBalance = ({
value,
onClickBalance,
className,
isDisabled,
isDisabled: isDisabledProp,
label = 'Balance'
}: TokenInputBalanceProps): JSX.Element => (
<StyledTokenInputBalanceWrapper className={className}>
<StyledTokenInputBalanceLabel>{label}</StyledTokenInputBalanceLabel>
<dd>
<StyledTokenInputBalanceValue>{ticker ? value : 0}</StyledTokenInputBalanceValue>
</dd>
// TODO: change border radius
<CTA onPress={onClickBalance} disabled={isDisabled} size='x-small'>
MAX
</CTA>
</StyledTokenInputBalanceWrapper>
);
}: TokenInputBalanceProps): JSX.Element => {
const isDisabled = isDisabledProp || !ticker || value === 0;

return (
<StyledTokenInputBalanceWrapper className={className}>
<StyledTokenInputBalanceLabel>{label}</StyledTokenInputBalanceLabel>
<dd>
<StyledTokenInputBalanceValue>{ticker ? value : 0}</StyledTokenInputBalanceValue>
</dd>
<CTA onPress={onClickBalance} disabled={isDisabled} size='x-small'>
MAX
</CTA>
</StyledTokenInputBalanceWrapper>
);
};

export { TokenInputBalance };
export type { TokenInputBalanceProps };

0 comments on commit 2ddf391

Please sign in to comment.