-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into habib/setup-rudderstack
- Loading branch information
Showing
26 changed files
with
280 additions
and
38 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
DEV_PEM_PATH=./cert/dev.pem | ||
CERT_PEM_PATH=./cert/cert.pem |
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 |
---|---|---|
|
@@ -31,3 +31,5 @@ yarn-error.log* | |
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
cert.pem | ||
dev.pem |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
// paste the CERTIFICATE starting from -----BEGIN CERTIFICATE----- |
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 @@ | ||
// paste the CERTIFICATE starting from -----BEGIN CERTIFICATE----- |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
68 changes: 68 additions & 0 deletions
68
src/cfd/modals/CTraderSuccessModal/CTraderSuccessModal.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,68 @@ | ||
import { useCallback } from 'react'; | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
import { PlatformDetails } from '@cfd/constants'; | ||
import { CFDSuccess } from '@cfd/screens'; | ||
import { Button, Modal } from '@deriv-com/ui'; | ||
|
||
import { useQueryParams } from '@/hooks'; | ||
import { useUIContext } from '@/providers'; | ||
|
||
export const CTraderSuccessModal = () => { | ||
const navigate = useNavigate(); | ||
const { uiState } = useUIContext(); | ||
const { isModalOpen, closeModal } = useQueryParams(); | ||
|
||
const isDemo = uiState.accountType === 'demo'; | ||
|
||
const renderButtons = useCallback( | ||
() => | ||
isDemo ? ( | ||
<Button className='rounded-xs' onClick={closeModal}> | ||
Continue | ||
</Button> | ||
) : ( | ||
<div className='space-x-10'> | ||
<Button | ||
className='border-2 rounded-xs border-system-light-less-prominent' | ||
color='black' | ||
onClick={closeModal} | ||
variant='outlined' | ||
> | ||
Maybe later | ||
</Button> | ||
<Button | ||
className='rounded-xs' | ||
onClick={() => { | ||
closeModal(); | ||
navigate('/cashier/transfer'); | ||
}} | ||
> | ||
Transfer funds | ||
</Button> | ||
</div> | ||
), | ||
[closeModal, isDemo, navigate] | ||
); | ||
|
||
const description = isDemo | ||
? `Congratulations, you have successfully created your demo ${PlatformDetails.ctrader.title} CFDs account.` | ||
: `Congratulations, you have successfully created your real ${PlatformDetails.ctrader.title} CFDs account. To start trading, transfer funds from your Deriv account into this account.`; | ||
|
||
return ( | ||
<Modal | ||
isOpen={isModalOpen('CTraderSuccessModal')} | ||
onRequestClose={closeModal} | ||
ariaHideApp={false} | ||
className='max-w-[440px] rounded-sm h-auto' | ||
> | ||
<Modal.Body> | ||
<CFDSuccess | ||
description={description} | ||
platform={PlatformDetails.ctrader.platform} | ||
renderButtons={renderButtons} | ||
/> | ||
</Modal.Body> | ||
</Modal> | ||
); | ||
}; |
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 { CTraderSuccessModal } from './CTraderSuccessModal'; |
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
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
Oops, something went wrong.