Skip to content

Commit

Permalink
feat: hide balance and max button when no wallet connected
Browse files Browse the repository at this point in the history
  • Loading branch information
RyukTheCoder authored and mikasackermn committed Jul 27, 2024
1 parent 270e7ff commit 80b2754
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions widget/embedded/src/containers/Inputs/Inputs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export function Inputs(props: PropTypes) {
onSelectMaxBalance={() => {
setInputAmount(tokenBalanceReal.split(',').join(''));
}}
anyWalletConnected={connectedWallets.length > 0}
/>
<SwitchFromAndToButton />
</FromContainer>
Expand Down
3 changes: 2 additions & 1 deletion widget/ui/src/containers/SwapInput/SwapInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ export function SwapInput(props: SwapInputPropTypes) {
'balance' in props &&
!props.loading &&
!props.loadingBalance &&
props.token.displayName;
props.token.displayName &&
props.anyWalletConnected;

const showBalanceSkeleton =
'balance' in props && (props.loading || props.loadingBalance);
Expand Down
1 change: 1 addition & 0 deletions widget/ui/src/containers/SwapInput/SwapInput.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type FromProps = {
loadingBalance: boolean;
onSelectMaxBalance: () => void;
onInputChange: (inputAmount: string) => void;
anyWalletConnected: boolean;
};

type ToProps = {
Expand Down

0 comments on commit 80b2754

Please sign in to comment.