-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NO CHANGELOG][Add Funds Widget] Add validation for selected deliver …
…to and pay with wallets (#2312)
- Loading branch information
Showing
9 changed files
with
146 additions
and
24 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
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
62 changes: 62 additions & 0 deletions
62
packages/checkout/widgets-lib/src/widgets/add-funds/components/AddressMissmatchDrawer.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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { | ||
Body, Box, Button, Drawer, Heading, | ||
} from '@biom3/react'; | ||
import { WalletWarningHero } from '../../../components/Hero/WalletWarningHero'; | ||
|
||
export interface AddressMissmatchDrawerProps { | ||
visible: boolean; | ||
onClick: () => void; | ||
} | ||
|
||
export function AddressMissmatchDrawer({ | ||
visible, | ||
onClick, | ||
}: AddressMissmatchDrawerProps) { | ||
return ( | ||
<Drawer size="full" visible={visible} showHeaderBar={false}> | ||
<Drawer.Content> | ||
<WalletWarningHero /> | ||
<Box sx={{ px: 'base.spacing.x6' }}> | ||
<Heading | ||
sx={{ | ||
marginTop: 'base.spacing.x6', | ||
marginBottom: 'base.spacing.x2', | ||
textAlign: 'center', | ||
}} | ||
> | ||
Oops! It seems your payment wallet has changed | ||
</Heading> | ||
<Body | ||
size="medium" | ||
sx={{ | ||
display: 'block', | ||
textAlign: 'center', | ||
color: 'base.color.text.body.secondary', | ||
marginBottom: 'base.spacing.x21', | ||
}} | ||
> | ||
You'll be ask to re-connect the same wallet you selected to pay with before proceeding. | ||
</Body> | ||
</Box> | ||
<Box | ||
sx={{ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
paddingX: 'base.spacing.x6', | ||
width: '100%', | ||
}} | ||
> | ||
<Button | ||
sx={{ width: '100%', marginBottom: 'base.spacing.x10' }} | ||
testId="non-passport-cta-button" | ||
variant="primary" | ||
size="large" | ||
onClick={onClick} | ||
> | ||
Re-select payment wallet | ||
</Button> | ||
</Box> | ||
</Drawer.Content> | ||
</Drawer> | ||
); | ||
} |
6 changes: 6 additions & 0 deletions
6
...heckout/widgets-lib/src/widgets/add-funds/functions/convertToNetworkChangeableProvider.ts
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { ethers } from 'ethers'; | ||
import { Web3Provider } from '@ethersproject/providers'; | ||
|
||
export const convertToNetworkChangeableProvider = async ( | ||
provider: Web3Provider, | ||
): Promise<Web3Provider> => new ethers.providers.Web3Provider(provider.provider, 'any'); |
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
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