diff --git a/apps/staking/src/components/AccountSummary/index.tsx b/apps/staking/src/components/AccountSummary/index.tsx index 17cf01bf47..0e4a3b1c89 100644 --- a/apps/staking/src/components/AccountSummary/index.tsx +++ b/apps/staking/src/components/AccountSummary/index.tsx @@ -115,11 +115,32 @@ export const AccountSummary = ({ transfer={api.deposit} enableWithZeroMax /> - + {availableToWithdraw === 0n ? ( + + + +

+ You have no tokens available for withdrawal +

+ +
+ +
+ You can only withdraw tokens that are unlocked and not + staked in either OIS or Pyth Governance +
+
+
+
+ ) : ( + + )} {api.type === ApiStateType.Loaded ? ( diff --git a/apps/staking/src/components/WalletButton/index.tsx b/apps/staking/src/components/WalletButton/index.tsx index 6aa7e3340e..594d3871d1 100644 --- a/apps/staking/src/components/WalletButton/index.tsx +++ b/apps/staking/src/components/WalletButton/index.tsx @@ -5,7 +5,6 @@ import { ArrowsRightLeftIcon, XCircleIcon, ChevronDownIcon, - TableCellsIcon, BanknotesIcon, ChevronRightIcon, CheckIcon, @@ -19,7 +18,6 @@ import { type ComponentProps, type ReactNode, useCallback, - useState, useMemo, type ReactElement, } from "react"; @@ -42,10 +40,8 @@ import { import { StateType as DataStateType, useData } from "../../hooks/use-data"; import { useLogger } from "../../hooks/use-logger"; import { usePrimaryDomain } from "../../hooks/use-primary-domain"; -import { AccountHistory } from "../AccountHistory"; import { Button } from "../Button"; import { Menu, MenuItem, Section, Separator } from "../Menu"; -import { ModalDialog } from "../ModalDialog"; import { TruncatedKey } from "../TruncatedKey"; const ONE_SECOND_IN_MS = 1000; @@ -103,10 +99,6 @@ const ConnectedButton = ({ api, ...props }: ConnectedButtonProps) => { - const [accountHistoryOpen, setAccountHistoryOpen] = useState(false); - const openAccountHistory = useCallback(() => { - setAccountHistoryOpen(true); - }, [setAccountHistoryOpen]); const modal = useWalletModal(); const showModal = useCallback(() => { modal.setVisible(true); @@ -120,61 +112,39 @@ const ConnectedButton = ({ }, [wallet, logger]); return ( - <> - - - - - - - - - {api.type === ApiStateType.Loaded && ( - <> -
- - - Select stake account - - - - - Account history + + + + + + + + + {api.type === ApiStateType.Loaded && ( + <> +
+ + + Select stake account + -
- - - )} -
- - Change wallet - - - Disconnect - -
-
-
- {api.type === ApiStateType.Loaded && ( - - - - )} - + +
+ + )} +
+ + Change wallet + + + Disconnect + +
+
+
); }; @@ -206,47 +176,47 @@ const StakeAccountSelector = ({ children, api }: StakeAccountSelectorProps) => { } }, [data, api]); - if (accounts === undefined) { + return accounts === undefined || // eslint-disable-next-line unicorn/no-null - return null; - } else if (accounts.main === undefined) { - return accounts.other.length > 1 ? ( - - {children} - - {({ account }) => } - - - ) : // eslint-disable-next-line unicorn/no-null - null; - } else { - return ( - - {children} - -
-
Main Account
- -
- {accounts.other.length > 0 && ( - <> - -
-
- Other Accounts -
- - {({ account }) => ( - - )} - -
- - )} -
-
- ); - } + (accounts.main === undefined && accounts.other.length === 1) ? null : ( + <> +
+ + {children} + + {accounts.main === undefined ? ( + ({ account }) => + ) : ( + <> +
+
+ Main Account +
+ +
+ {accounts.other.length > 0 && ( + <> + +
+
+ Other Accounts +
+ + {({ account }) => ( + + )} + +
+ + )} + + )} +
+
+
+ + + ); }; type AccountMenuItemProps = {