Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/staking/src/components/AccountSummary/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export const AccountSummary = ({
actionName="Add Tokens"
max={walletAmount}
transfer={api.deposit}
enableWithZeroMax
/>
</div>
</div>
Expand Down
6 changes: 5 additions & 1 deletion apps/staking/src/components/TransferButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { Tokens } from "../Tokens";
import PythTokensIcon from "../Tokens/pyth.svg";

type Props = Omit<ComponentProps<typeof Button>, "children"> & {
enableWithZeroMax?: boolean | undefined;
actionName: ReactNode;
actionDescription: ReactNode;
title?: ReactNode | undefined;
Expand All @@ -37,6 +38,7 @@ type Props = Omit<ComponentProps<typeof Button>, "children"> & {
};

export const TransferButton = ({
enableWithZeroMax,
actionName,
submitButtonText,
actionDescription,
Expand All @@ -49,7 +51,9 @@ export const TransferButton = ({
}: Props) => {
const [closeDisabled, setCloseDisabled] = useState(false);

return transfer === undefined || isDisabled === true || max === 0n ? (
return transfer === undefined ||
isDisabled === true ||
(max === 0n && !enableWithZeroMax) ? (
<Button isDisabled={true} {...props}>
{actionName}
</Button>
Expand Down
Loading