Skip to content

Commit

Permalink
feat: add add token button to account menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Polybius93 committed Nov 25, 2024
1 parent 9c036d3 commit c6dd329
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/app/components/account/components/account-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
Text,
useBreakpointValue,
} from '@chakra-ui/react';
import { useAddToken } from '@hooks/use-add-token';
import { XRPWallet } from '@models/wallet';
import { truncateAddress } from 'dlc-btc-lib/utilities';
import { Connector } from 'wagmi';
Expand All @@ -24,6 +25,8 @@ export function AccountMenu({
wallet,
handleDisconnectWallet,
}: AccountMenuProps): React.JSX.Element | false {
const addToken = useAddToken();

const isMobile = useBreakpointValue({ base: true, md: false });

if (!address) return false;
Expand Down Expand Up @@ -52,6 +55,7 @@ export function AccountMenu({
</HStack>
</MenuButton>
<MenuList>
<MenuItem onClick={() => addToken()}>Add Token To Wallet</MenuItem>
<MenuItem onClick={() => handleDisconnectWallet()}>Disconnect</MenuItem>
</MenuList>
</Menu>
Expand Down
2 changes: 1 addition & 1 deletion src/app/hooks/use-add-token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function useAddToken(): () => Promise<void> {
type: 'ERC20',
options: {
address: ethereumNetworkConfiguration.dlcBTCContract.address,
symbol: 'dlcBTC',
symbol: 'iBTC',
decimals: 8,
image: 'https://dlc-public-assets.s3.amazonaws.com/dlcBTC_Token.png',
},
Expand Down

0 comments on commit c6dd329

Please sign in to comment.