Skip to content

Commit

Permalink
fix: enable all forms for not connected wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
solidovic committed Oct 30, 2024
1 parent 3990b0c commit a210af0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions features/stake/stake-form/controls/stake-amount-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import { useStakeFormData } from '../stake-form-context';
import { useStakingLimitWarning, useDappStatus } from 'modules/web3';

export const StakeAmountInput = () => {
const { isDappActive } = useDappStatus();
const { isWalletConnected, isDappActive } = useDappStatus();
const { maxAmount, stakingLimitInfo } = useStakeFormData();
const { limitWarning, limitError } = useStakingLimitWarning(
stakingLimitInfo?.stakeLimitLevel,
);

return (
<TokenAmountInputHookForm
disabled={!isDappActive}
disabled={isWalletConnected && !isDappActive}
fieldName="amount"
token={'ETH'}
data-testid="stakeInput"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ import { TokenAmountInputHookForm } from 'shared/hook-form/controls/token-amount
import { useDappStatus } from 'modules/web3';

export const TokenAmountInputRequest = () => {
const { isDappActive } = useDappStatus();
const { isWalletConnected, isDappActive } = useDappStatus();
const token = useWatch<RequestFormInputType, 'token'>({ name: 'token' });
const { maxAmount, isTokenLocked } = useRequestFormData();

const { balanceDiff } = useTvlMessage();

return (
<TokenAmountInputHookForm
disabled={!isDappActive}
disabled={isWalletConnected && !isDappActive}
fieldName="amount"
data-testid="requestInput"
token={token}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ const OPTIONS: TokenOption[] = [
];

export const TokenSelectRequest = () => {
const { isDappActive } = useDappStatus();
const { isWalletConnected, isDappActive } = useDappStatus();

return <TokenSelectHookForm disabled={!isDappActive} options={OPTIONS} />;
return (
<TokenSelectHookForm
disabled={isWalletConnected && !isDappActive}
options={OPTIONS}
/>
);
};

0 comments on commit a210af0

Please sign in to comment.