-
Notifications
You must be signed in to change notification settings - Fork 303
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WALL-2700/chore: fix jurisdiction tnc section and add proper terms an…
…d condition links (#11643) * chore: fix jurisdiction tnc section and add proper terms and condition links * fix: style repetition * fix: sonarcloud and komen
- Loading branch information
1 parent
49ef74f
commit bc09647
Showing
8 changed files
with
134 additions
and
47 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
33 changes: 33 additions & 0 deletions
33
.../src/features/cfd/screens/Jurisdiction/JurisdictionTncSection/JurisdictionTncSection.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,33 @@ | ||
.wallets-jurisdiction-tnc { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1.2rem; | ||
justify-content: center; | ||
margin-top: 3rem; | ||
|
||
@include mobile { | ||
position: sticky; | ||
bottom: 0; | ||
background: var(--system-light-8-primary-background, #fff); | ||
justify-content: center; | ||
padding: 1.5rem 2rem 1rem; | ||
width: 100vw; | ||
} | ||
|
||
&-checkbox { | ||
align-items: center; | ||
display: flex; | ||
gap: 0.8rem; | ||
justify-content: center; | ||
|
||
&__link { | ||
color: var(--brand-coral, #ff444f); | ||
} | ||
|
||
&__link, | ||
&-input, | ||
&-label { | ||
cursor: pointer; | ||
} | ||
} | ||
} |
80 changes: 80 additions & 0 deletions
80
...s/src/features/cfd/screens/Jurisdiction/JurisdictionTncSection/JurisdictionTncSection.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,80 @@ | ||
import React from 'react'; | ||
import { WalletText } from '../../../../../components/Base'; | ||
import { useModal } from '../../../../../components/ModalProvider'; | ||
import { getStaticUrl } from '../../../../../helpers/urls'; | ||
import useDevice from '../../../../../hooks/useDevice'; | ||
import { THooks } from '../../../../../types'; | ||
import { companyNamesAndUrls } from '../../../constants'; | ||
import { JurisdictionFootNoteTitle } from '../JurisdictionFootNoteTitle'; | ||
import './JurisdictionTncSection.scss'; | ||
|
||
type TProps = { | ||
isCheckBoxChecked: boolean; | ||
selectedJurisdiction: THooks.AvailableMT5Accounts['shortcode']; | ||
setIsCheckBoxChecked: React.Dispatch<React.SetStateAction<boolean>>; | ||
}; | ||
|
||
const JurisdictionTncSection: React.FC<TProps> = ({ | ||
isCheckBoxChecked, | ||
selectedJurisdiction, | ||
setIsCheckBoxChecked, | ||
}) => { | ||
const { isMobile } = useDevice(); | ||
const { getModalState } = useModal(); | ||
const marketType = getModalState('marketType') || 'all'; | ||
return ( | ||
<div className='wallets-jurisdiction-tnc'> | ||
{selectedJurisdiction && ( | ||
<JurisdictionFootNoteTitle marketType={marketType} selectedJurisdiction={selectedJurisdiction} /> | ||
)} | ||
{selectedJurisdiction && selectedJurisdiction !== 'svg' && ( | ||
<div className='wallets-jurisdiction-tnc-checkbox'> | ||
<input | ||
checked={isCheckBoxChecked} | ||
className='wallets-jurisdiction-tnc-checkbox-input' | ||
id='tnc-checkbox' | ||
onChange={(event: React.ChangeEvent<HTMLInputElement>) => | ||
setIsCheckBoxChecked(event.target.checked) | ||
} | ||
type='checkbox' | ||
/> | ||
<label className='wallets-jurisdiction-tnc-checkbox-label' htmlFor='tnc-checkbox'> | ||
<WalletText size={isMobile ? 'sm' : 'md'}> | ||
I confirm and accept Deriv (V) Ltd‘s{' '} | ||
<a | ||
className='wallets-jurisdiction-tnc-checkbox__link' | ||
onClick={() => { | ||
window.open( | ||
getStaticUrl( | ||
companyNamesAndUrls[ | ||
selectedJurisdiction as keyof typeof companyNamesAndUrls | ||
].tncUrl | ||
), | ||
'_blank' | ||
); | ||
}} | ||
// Reason: To fix sonarcloud issue | ||
onKeyDown={(event: React.KeyboardEvent<HTMLAnchorElement>) => { | ||
if (event.key === 'Enter') { | ||
window.open( | ||
getStaticUrl( | ||
companyNamesAndUrls[ | ||
selectedJurisdiction as keyof typeof companyNamesAndUrls | ||
].tncUrl | ||
), | ||
'_blank' | ||
); | ||
} | ||
}} | ||
> | ||
Terms and Conditions | ||
</a> | ||
</WalletText> | ||
</label> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default JurisdictionTncSection; |
1 change: 1 addition & 0 deletions
1
packages/wallets/src/features/cfd/screens/Jurisdiction/JurisdictionTncSection/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 JurisdictionTncSection } from './JurisdictionTncSection'; |
1 change: 1 addition & 0 deletions
1
packages/wallets/src/features/cfd/screens/Jurisdiction/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 |
---|---|---|
@@ -1 +1,2 @@ | ||
export { default as JurisdictionScreen } from './JurisdictionScreen'; | ||
export * from './JurisdictionTncSection'; |
bc09647
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
deriv-app – ./
deriv-app.vercel.app
deriv-app-git-master.binary.sx
deriv-app.binary.sx
binary.sx