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.
adrienne / added jurisdiction modal for desktop (deriv-com#10330)
* feat: added wide wrapper for jurisdiction modal * feat: added desktop view for jurisdiction modal * chore: updated package-lock.json for wallets * chore: removed package-lock.json in wallets * chore: updated component typings based on comments * chore: updated comments based on reviews * chore: fixed issues with circleci for wallets * chore: removed duplicated packages in wallets
- Loading branch information
1 parent
34393a4
commit bf02321
Showing
10 changed files
with
35,681 additions
and
10 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
80 changes: 80 additions & 0 deletions
80
packages/wallets/src/components/JurisdictionModal/JurisdictionCard.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,80 @@ | ||
.wallets-jurisdiction-card { | ||
align-items: center; | ||
border-radius: 16px; | ||
border: 2px solid #f2f3f4; | ||
cursor: pointer; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
max-width: 25%; | ||
position: relative; | ||
transform-style: preserve-3d; | ||
transition-duration: 0.6s; | ||
transition-property: transform, box-shadow; | ||
|
||
&__link { | ||
color: #ff444f; | ||
} | ||
|
||
&:hover { | ||
box-shadow: 0px 24px 48px 0px rgba(14, 14, 14, 0.18); | ||
} | ||
|
||
&--selected { | ||
border: 2px solid #85acb0; | ||
box-shadow: 0px 24px 48px 0px rgba(14, 14, 14, 0.18); | ||
} | ||
|
||
&--flip { | ||
transform: rotateY(180deg); | ||
} | ||
|
||
&-front { | ||
backface-visibility: hidden; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
padding: 20px 16px; | ||
transform-style: preserve-3d; | ||
transition: transform 0.6s; | ||
|
||
&--flip { | ||
transform: rotateY(180deg); | ||
} | ||
|
||
&__label { | ||
font-size: 20px; | ||
font-weight: 700; | ||
line-height: 30px; | ||
margin-bottom: 10px; | ||
text-align: center; | ||
margin-top: 20px; | ||
} | ||
|
||
&__tag { | ||
background-color: #661b20; | ||
border-radius: 4px; | ||
color: #ffffff; | ||
font-weight: 700; | ||
padding: 1rem; | ||
|
||
&--assets { | ||
background-color: #661b20; | ||
} | ||
|
||
&--leverage { | ||
background-color: #ffa912; | ||
} | ||
|
||
&--spreads-from { | ||
background-color: #4a3871; | ||
} | ||
} | ||
} | ||
|
||
&-back { | ||
backface-visibility: hidden; | ||
transform: rotateY(180deg); | ||
position: absolute; | ||
} | ||
} |
78 changes: 78 additions & 0 deletions
78
packages/wallets/src/components/JurisdictionModal/JurisdictionCard.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,78 @@ | ||
import React from 'react'; | ||
import classNames from 'classnames'; | ||
import JurisdictionCardRow from './JurisdictionCardRow'; | ||
import JurisdictionCardTag from './JurisdictionCardTag'; | ||
import './JurisdictionCard.scss'; | ||
|
||
type TJurisdictionCardProps = { | ||
isSelected: boolean; | ||
jurisdiction: string; | ||
onSelect: (clickedJurisdiction: string) => void; | ||
tag?: string; | ||
}; | ||
|
||
const JurisdictionCard: React.FC<TJurisdictionCardProps> = ({ isSelected, jurisdiction, onSelect, tag }) => { | ||
const [shouldFlip, setShouldFlip] = React.useState(false); | ||
|
||
return ( | ||
<div | ||
className={classNames('wallets-jurisdiction-card', { | ||
'wallets-jurisdiction-card--flip': shouldFlip, | ||
'wallets-jurisdiction-card--selected': isSelected, | ||
})} | ||
onClick={() => onSelect(jurisdiction)} | ||
> | ||
{!shouldFlip && tag && <JurisdictionCardTag tag={tag} />} | ||
<React.Fragment> | ||
<div className='wallets-jurisdiction-card-front'> | ||
<div className='wallets-jurisdiction-card-front__label'>{jurisdiction}</div> | ||
<JurisdictionCardRow | ||
description='Synthetics,baskets,and derived FX' | ||
renderTag={() => ( | ||
<div className='wallets-jurisdiction-card-front__tag wallets-jurisdiction-card-front__tag--assets'> | ||
40+ | ||
</div> | ||
)} | ||
title='Assets' | ||
/> | ||
<JurisdictionCardRow | ||
description={<div className='wallets-jurisdiction-card__link'>Dynamic leverage</div>} | ||
renderTag={() => ( | ||
<div className='wallets-jurisdiction-card-front__tag wallets-jurisdiction-card-front__tag--leverage'> | ||
1:1000 | ||
</div> | ||
)} | ||
title='Leverage' | ||
/> | ||
|
||
<JurisdictionCardRow | ||
renderTag={() => ( | ||
<div className='wallets-jurisdiction-card-front__tag wallets-jurisdiction-card-front__tag--spreads-from'> | ||
0.6 pips | ||
</div> | ||
)} | ||
title='Spreads from' | ||
/> | ||
<JurisdictionCardRow | ||
description={ | ||
<div> | ||
<a className='wallets-jurisdiction-card__link' onClick={() => setShouldFlip(true)}> | ||
Learn more | ||
</a>{' '} | ||
about required verifications. | ||
</div> | ||
} | ||
title='Verifications' | ||
/> | ||
<JurisdictionCardRow | ||
description='British Virgin Islands Financial Services Commission (Licence no. SIBA/L/18/1114)' | ||
title='Regulator' | ||
/> | ||
</div> | ||
<div className='wallets-jurisdiction-card-back'>IM BACK</div> | ||
</React.Fragment> | ||
</div> | ||
); | ||
}; | ||
|
||
export default JurisdictionCard; |
36 changes: 36 additions & 0 deletions
36
packages/wallets/src/components/JurisdictionModal/JurisdictionCardRow.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,36 @@ | ||
.wallets-jurisdiction-card-row { | ||
border-bottom: 2px solid #f2f3f4; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 8px; | ||
padding: 20px 0; | ||
width: 100%; | ||
&:last-child { | ||
border-bottom: none; | ||
} | ||
|
||
&__header { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
|
||
&-title { | ||
font-size: 14px; | ||
font-weight: 700; | ||
} | ||
|
||
&-badge { | ||
background-color: #661b20; | ||
border-radius: 4px; | ||
color: #ffffff; | ||
font-weight: 700; | ||
padding: 1rem; | ||
} | ||
} | ||
|
||
&__content { | ||
font-size: 12px; | ||
font-weight: 400; | ||
line-height: 20px; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
packages/wallets/src/components/JurisdictionModal/JurisdictionCardRow.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,22 @@ | ||
import React from 'react'; | ||
import './JurisdictionCardRow.scss'; | ||
|
||
type TJurisdictionCardRowProps = { | ||
description?: React.ReactNode | string; | ||
renderTag?: () => React.ReactNode; | ||
title: string; | ||
}; | ||
|
||
const JurisdictionCardRow: React.FC<TJurisdictionCardRowProps> = ({ description, renderTag, title }) => { | ||
return ( | ||
<div className='wallets-jurisdiction-card-row'> | ||
<div className='wallets-jurisdiction-card-row__header'> | ||
<div className='wallets-jurisdiction-card-row__header-title'>{title}</div> | ||
{renderTag && <div className='wallets-jurisdiction-card-row__header-tag'>{renderTag()}</div>} | ||
</div> | ||
{description && <div className='wallets-jurisdiction-card-row__content'>{description}</div>} | ||
</div> | ||
); | ||
}; | ||
|
||
export default JurisdictionCardRow; |
16 changes: 16 additions & 0 deletions
16
packages/wallets/src/components/JurisdictionModal/JurisdictionCardTag.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,16 @@ | ||
.wallets-jurisdiction-card-tag { | ||
background-color: #dfeaff; | ||
border-radius: 13px 13px 0 0; | ||
padding: 8px; | ||
position: absolute; | ||
top: 0; | ||
width: 100%; | ||
|
||
&__label { | ||
color: #377cfc; | ||
font-size: 12px; | ||
display: grid; | ||
place-items: center; | ||
font-weight: 700; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
packages/wallets/src/components/JurisdictionModal/JurisdictionCardTag.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,15 @@ | ||
import React from 'react'; | ||
import './JurisdictionCardTag.scss'; | ||
|
||
type TJurisdictionCardTagProps = { | ||
tag: string; | ||
}; | ||
const JurisdictionCardTag: React.FC<TJurisdictionCardTagProps> = ({ tag }) => { | ||
return ( | ||
<div className='wallets-jurisdiction-card-tag'> | ||
<div className='wallets-jurisdiction-card-tag__label'>{tag}</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default JurisdictionCardTag; |
47 changes: 41 additions & 6 deletions
47
packages/wallets/src/components/JurisdictionModal/JurisdictionModal.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 |
---|---|---|
@@ -1,20 +1,55 @@ | ||
.wallets-jurisdiction-modal { | ||
display: grid; | ||
align-items: center; | ||
border-radius: 16px; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 30px; | ||
height: 75vh; | ||
justify-content: center; | ||
margin: auto 4rem; | ||
width: 85vw; | ||
|
||
&__button { | ||
&__cards { | ||
align-items: center; | ||
display: flex; | ||
height: 40px; | ||
padding: 10px 16px; | ||
gap: 16px; | ||
justify-content: center; | ||
} | ||
|
||
&__button { | ||
align-items: center; | ||
background: #ff444f; | ||
border-radius: 4px; | ||
border: none; | ||
color: #ffffff; | ||
background: #ff444f; | ||
font-weight: 700; | ||
cursor: pointer; | ||
display: flex; | ||
font-weight: 700; | ||
height: 40px; | ||
justify-content: center; | ||
margin-left: 1rem; | ||
padding: 10px 16px; | ||
|
||
&--disabled { | ||
opacity: 0.4; | ||
} | ||
} | ||
|
||
&__tnc { | ||
display: flex; | ||
flex-direction: column; | ||
font-size: 14px; | ||
font-weight: 700; | ||
gap: 12px; | ||
justify-content: center; | ||
text-align: center; | ||
|
||
&-checkbox { | ||
align-items: center; | ||
display: flex; | ||
font-weight: 400; | ||
gap: 4px; | ||
justify-content: center; | ||
} | ||
} | ||
} |
44 changes: 41 additions & 3 deletions
44
packages/wallets/src/components/JurisdictionModal/JurisdictionModal.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