-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4f81a82
commit 7a2577b
Showing
10 changed files
with
353 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,44 @@ | ||
import { useContext } from 'react'; | ||
import { useDispatch } from 'react-redux'; | ||
|
||
import { HStack } from '@chakra-ui/react'; | ||
import { Button, HStack } from '@chakra-ui/react'; | ||
import { AccountMenu } from '@components/account/components/account-menu'; | ||
import { RippleWalletContext } from '@providers/ripple-user-wallet-context-provider'; | ||
import { mintUnmintActions } from '@store/slices/mintunmint/mintunmint.actions'; | ||
import { modalActions } from '@store/slices/modal/modal.actions'; | ||
|
||
// import { modalActions } from '@store/slices/modal/modal.actions'; | ||
import { useAccount, useDisconnect } from 'wagmi'; | ||
// import { useAccount, useDisconnect } from 'wagmi'; | ||
|
||
export function Account(): React.JSX.Element { | ||
const dispatch = useDispatch(); | ||
|
||
const { address, connector } = useAccount(); | ||
const { disconnect } = useDisconnect(); | ||
// const { address, connector } = useAccount(); | ||
// const { disconnect } = useDisconnect(); | ||
const { isRippleWalletInitialized, resetRippleWallet } = useContext(RippleWalletContext); | ||
|
||
// function onConnectWalletClick(): void { | ||
// dispatch(modalActions.toggleSelectWalletModalVisibility()); | ||
// } | ||
function onConnectWalletClick(): void { | ||
dispatch(modalActions.toggleSelectWalletModalVisibility()); | ||
} | ||
|
||
function onDisconnectWalletClick(): void { | ||
disconnect(); | ||
resetRippleWallet(); | ||
dispatch(mintUnmintActions.resetMintUnmintState()); | ||
} | ||
|
||
return ( | ||
<HStack w={'275px'}> | ||
{/* {isConnected ? ( */} | ||
<AccountMenu | ||
address={address} | ||
wagmiConnector={connector} | ||
handleDisconnectWallet={() => onDisconnectWalletClick()} | ||
/> | ||
{/* ) : ( */} | ||
{/* <Button variant={'account'} onClick={() => onConnectWalletClick()}> */} | ||
{/* Connect Wallet */} | ||
{/* </Button> */} | ||
{/* )} */} | ||
{isRippleWalletInitialized ? ( | ||
<AccountMenu | ||
// address={address} | ||
// wagmiConnector={connector} | ||
handleDisconnectWallet={() => onDisconnectWalletClick()} | ||
/> | ||
) : ( | ||
<Button variant={'account'} onClick={() => onConnectWalletClick()}> | ||
Connect Wallet | ||
</Button> | ||
)} | ||
</HStack> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
src/app/components/mint-unmint/components/setup-vault-screen/setup-vault-screen.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 46 additions & 46 deletions
92
src/app/components/modals/select-wallet-modal/components/select-wallet-menu.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,50 @@ | ||
import { Box, Button, HStack, Image, Spinner, Text } from '@chakra-ui/react'; | ||
import { Connector } from 'wagmi'; | ||
// import { Box, Button, HStack, Image, Spinner, Text } from '@chakra-ui/react'; | ||
// import { Connector } from 'wagmi'; | ||
|
||
interface SelectWalletMenuProps { | ||
wagmiConnector: Connector; | ||
selectedWagmiConnectorID?: string; | ||
isConnectWalletPending: boolean; | ||
isConnectWalletSuccess: boolean; | ||
handleConnectWallet: (wagmiConnector: Connector) => void; | ||
} | ||
// interface SelectWalletMenuProps { | ||
// wagmiConnector: Connector; | ||
// selectedWagmiConnectorID?: string; | ||
// isConnectWalletPending: boolean; | ||
// isConnectWalletSuccess: boolean; | ||
// handleConnectWallet: (wagmiConnector: Connector) => void; | ||
// } | ||
|
||
export function SelectWalletMenu({ | ||
wagmiConnector, | ||
selectedWagmiConnectorID, | ||
isConnectWalletPending, | ||
isConnectWalletSuccess, | ||
handleConnectWallet, | ||
}: SelectWalletMenuProps): React.JSX.Element { | ||
const { id, icon, name } = wagmiConnector; | ||
// export function SelectWalletMenu({ | ||
// wagmiConnector, | ||
// selectedWagmiConnectorID, | ||
// isConnectWalletPending, | ||
// isConnectWalletSuccess, | ||
// handleConnectWallet, | ||
// }: SelectWalletMenuProps): React.JSX.Element { | ||
// const { id, icon, name } = wagmiConnector; | ||
|
||
const isThisWalletSelected = selectedWagmiConnectorID === id; | ||
// const isThisWalletSelected = selectedWagmiConnectorID === id; | ||
|
||
return ( | ||
<Button | ||
borderColor={ | ||
isConnectWalletSuccess && isThisWalletSelected ? 'accent.lightBlue.01' : 'border.white.01' | ||
} | ||
variant={'wallet'} | ||
onClick={() => handleConnectWallet(wagmiConnector)} | ||
> | ||
<Box position="relative" w={'100%'} display={'flex'} justifyContent={'center'}> | ||
<HStack | ||
justifyContent={'space-evenly'} | ||
w={'250px'} | ||
filter={isConnectWalletPending && isThisWalletSelected ? 'opacity(25%)' : 'none'} | ||
> | ||
<Image | ||
src={name === 'WalletConnect' ? './images/logos/walletconnect.svg' : icon} | ||
alt={name} | ||
boxSize={'25px'} | ||
/> | ||
<Text w={'150px'}>{name}</Text> | ||
</HStack> | ||
{isConnectWalletPending && isThisWalletSelected && ( | ||
<Spinner size={'md'} color={'accent.lightBlue.01'} position={'absolute'} /> | ||
)} | ||
</Box> | ||
</Button> | ||
); | ||
} | ||
// return ( | ||
// <Button | ||
// borderColor={ | ||
// isConnectWalletSuccess && isThisWalletSelected ? 'accent.lightBlue.01' : 'border.white.01' | ||
// } | ||
// variant={'wallet'} | ||
// onClick={() => handleConnectWallet(wagmiConnector)} | ||
// > | ||
// <Box position="relative" w={'100%'} display={'flex'} justifyContent={'center'}> | ||
// <HStack | ||
// justifyContent={'space-evenly'} | ||
// w={'250px'} | ||
// filter={isConnectWalletPending && isThisWalletSelected ? 'opacity(25%)' : 'none'} | ||
// > | ||
// <Image | ||
// src={name === 'WalletConnect' ? './images/logos/walletconnect.svg' : icon} | ||
// alt={name} | ||
// boxSize={'25px'} | ||
// /> | ||
// <Text w={'150px'}>{name}</Text> | ||
// </HStack> | ||
// {isConnectWalletPending && isThisWalletSelected && ( | ||
// <Spinner size={'md'} color={'accent.lightBlue.01'} position={'absolute'} /> | ||
// )} | ||
// </Box> | ||
// </Button> | ||
// ); | ||
// } |
Oops, something went wrong.