forked from deriv-com/deriv-app
-
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.
feat: fiat on ramp disclaimer screen (deriv-com#11246)
- Loading branch information
1 parent
e478db2
commit 9c6ca8c
Showing
8 changed files
with
110 additions
and
31 deletions.
There are no files selected for viewing
58 changes: 34 additions & 24 deletions
58
packages/wallets/src/features/cashier/modules/FiatOnRamp/FiatOnRamp.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
19 changes: 19 additions & 0 deletions
19
...ures/cashier/modules/FiatOnRamp/components/FiatOnRampDisclaimer/FiatOnRampDisclaimer.scss
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,19 @@ | ||
.wallets-fiat-onramp-disclaimer { | ||
align-items: flex-start; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1.6rem; | ||
justify-content: center; | ||
max-width: 79.2rem; | ||
|
||
@include mobile { | ||
justify-content: flex-start; | ||
} | ||
|
||
&__buttons { | ||
display: flex; | ||
gap: 0.8rem; | ||
justify-content: flex-end; | ||
width: 100%; | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
...tures/cashier/modules/FiatOnRamp/components/FiatOnRampDisclaimer/FiatOnRampDisclaimer.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,43 @@ | ||
import React, { MouseEventHandler, useCallback } from 'react'; | ||
import { useQuery } from '@deriv/api'; | ||
import { WalletButton, WalletText } from '../../../../../../components'; | ||
import './FiatOnRampDisclaimer.scss'; | ||
|
||
type TFiatOnRampDisclaimer = { | ||
handleDisclaimer: MouseEventHandler<HTMLButtonElement>; | ||
}; | ||
|
||
const FiatOnRampDisclaimer: React.FC<TFiatOnRampDisclaimer> = ({ handleDisclaimer }) => { | ||
const { data: provider } = useQuery('service_token', { | ||
payload: { referrer: window.location.href, service: 'banxa' }, | ||
}); | ||
|
||
const redirectToBanxa = useCallback(() => { | ||
const banxaUrl = provider?.service_token?.banxa?.url ?? ''; | ||
if (banxaUrl) { | ||
const link = document.createElement('a'); | ||
link.href = banxaUrl; | ||
link.target = '_blank'; | ||
link.click(); | ||
} | ||
}, [provider?.service_token?.banxa?.url]); | ||
|
||
return ( | ||
<div className='wallets-fiat-onramp-disclaimer'> | ||
<WalletText color='prominent' size='md' weight='bold'> | ||
Disclaimer | ||
</WalletText> | ||
<WalletText size='sm'> | ||
By clicking <strong>Continue</strong>, you'll be redirected to Banxa, a third-party payment service | ||
provider. Please note that Deriv is not responsible for the content or services provided by Banxa. If | ||
you encounter any issues related to Banxa services, you should contact Banxa directly. | ||
</WalletText> | ||
<div className='wallets-fiat-onramp-disclaimer__buttons'> | ||
<WalletButton color='white' onClick={handleDisclaimer} size='md' text={'Back'} variant='outlined' /> | ||
<WalletButton onClick={() => redirectToBanxa()} size='md' text={'Continue'} /> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default FiatOnRampDisclaimer; |
1 change: 1 addition & 0 deletions
1
.../wallets/src/features/cashier/modules/FiatOnRamp/components/FiatOnRampDisclaimer/index.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 @@ | ||
export { default as FiatOnRampDisclaimer } from './FiatOnRampDisclaimer'; |
File renamed without changes.
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
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
packages/wallets/src/features/cashier/modules/FiatOnRamp/components/index.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,2 @@ | ||
export * from './FiatOnRampDisclaimer'; | ||
export * from './FiatOnRampProviderCard'; |