-
Notifications
You must be signed in to change notification settings - Fork 322
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEQ] Added routes and tabs for My Profile page (#13113)
* chore: removed responsive root * chore: reverted old changes * feat: setup route for my-profile * chore: refactored code based on reviews * feat: added tabs for desktop view * feat: added tabs for desktop view * feat: added tabs for desktop view * feat: added tabs for desktop view * feat: added tabs for desktop view * Delete packages/p2p-v2/package-lock.json.3009233934 * feat: added mobile tabs for p2p-v2 * feat: integrated usequerystring, added counterparties to tab * chore: refactor daily limit modal * feat: integrated payment methods * fix: added default tab for my profile * feat: added available balance modal * refactor: my counterparties components to subfolders * fix: issue with counterparties search bar not full width * chore: refactored based on reviews * chore: resolved code reviews * fix: loader is fullscreen and eligibility for upgrde * chore: fix sonarcloud issue, remove default value
- Loading branch information
1 parent
0be857a
commit 79ce371
Showing
62 changed files
with
687 additions
and
147 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
20 changes: 20 additions & 0 deletions
20
packages/p2p-v2/src/components/CloseHeader/CloseHeader.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,20 @@ | ||
import React from 'react'; | ||
import { useDevice } from '../../hooks'; | ||
import CrossIcon from '../../public/ic-cross.svg'; | ||
import './CloseHeader.scss'; | ||
import { Text } from '@deriv-com/ui/dist/components/Text'; | ||
|
||
const CloseHeader = () => { | ||
const { isMobile } = useDevice(); | ||
|
||
return ( | ||
<div className='p2p-v2-close-header'> | ||
<Text size={isMobile ? 'md' : 'xl'} weight='bold'> | ||
{isMobile ? 'Deriv P2P' : 'Cashier'} | ||
</Text> | ||
<CrossIcon className='p2p-v2-close-header--icon' onClick={() => window.history.back()} /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default CloseHeader; |
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 CloseHeader } from './CloseHeader'; |
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
14 changes: 0 additions & 14 deletions
14
packages/p2p-v2/src/components/MobileCloseHeader/MobileCloseHeader.tsx
This file was deleted.
Oops, something went wrong.
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.p2p-v2-mobile-tabs { | ||
display: flex; | ||
flex-direction: column; | ||
|
||
& button { | ||
padding: 2.3rem 1.6rem; | ||
display: flex; | ||
justify-content: space-between; | ||
border-bottom: 0.1rem solid #e6e9e9; | ||
|
||
&:last-child { | ||
border-bottom: none; | ||
} | ||
} | ||
} |
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,24 @@ | ||
import React from 'react'; | ||
import { Text } from '@deriv-com/ui/dist/components/Text'; | ||
import RightArrowIcon from '../../public/ic-chevron-right.svg'; | ||
import './MobileTabs.scss'; | ||
|
||
type TMobileTabsProps<T extends string[]> = { | ||
onChangeTab: (clickedTab: T[number]) => void; | ||
tabs: T; | ||
}; | ||
|
||
function MobileTabs<T extends string[]>({ onChangeTab, tabs }: TMobileTabsProps<T>) { | ||
return ( | ||
<div className='p2p-v2-mobile-tabs'> | ||
{tabs.map((tab, i) => ( | ||
<button className='p2p-v2-mobile-tabs__tab' key={`${tab}-${i}`} onClick={() => onChangeTab(tab)}> | ||
<Text size='sm'>{tab}</Text> | ||
<RightArrowIcon /> | ||
</button> | ||
))} | ||
</div> | ||
); | ||
} | ||
|
||
export default MobileTabs; |
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 MobileTabs } from './MobileTabs'; |
32 changes: 32 additions & 0 deletions
32
packages/p2p-v2/src/components/Modals/AvailableP2PBalanceModal/AvailableP2PBalanceModal.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,32 @@ | ||
.p2p-v2-available-p2p-balance-modal { | ||
position: absolute; | ||
top: 50%; | ||
left: 50%; | ||
right: auto; | ||
bottom: auto; | ||
transform: translate(-50%, -50%); | ||
width: 44rem; | ||
padding: 2.4rem; | ||
border-radius: 8px; | ||
background: #fff; | ||
box-shadow: 0px 32px 64px 0px rgba(14, 14, 14, 0.14); | ||
|
||
&__text { | ||
margin: 2.4rem 0; | ||
|
||
@include mobile { | ||
margin: 1.6rem 0; | ||
} | ||
} | ||
|
||
@include mobile { | ||
padding: 1.6rem; | ||
width: 32.8rem; | ||
} | ||
|
||
&__footer { | ||
display: flex; | ||
justify-content: flex-end; | ||
gap: 0.8rem; | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
packages/p2p-v2/src/components/Modals/AvailableP2PBalanceModal/AvailableP2PBalanceModal.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,45 @@ | ||
import React, { useEffect } from 'react'; | ||
import Modal from 'react-modal'; | ||
import { Text } from '@deriv-com/ui/dist/components/Text'; | ||
import { Button } from '@deriv-com/ui/dist/components/Button'; | ||
import { customStyles } from '../helpers'; | ||
import './AvailableP2PBalanceModal.scss'; | ||
|
||
type TAvailableP2PBalanceModalProps = { | ||
isModalOpen: boolean; | ||
onRequestClose: () => void; | ||
}; | ||
|
||
const AvailableP2PBalanceModal = ({ isModalOpen, onRequestClose }: TAvailableP2PBalanceModalProps) => { | ||
useEffect(() => { | ||
Modal.setAppElement('#v2_modal_root'); | ||
}, []); | ||
|
||
return ( | ||
<Modal | ||
className='p2p-v2-available-p2p-balance-modal' | ||
isOpen={isModalOpen} | ||
onRequestClose={onRequestClose} | ||
shouldCloseOnOverlayClick={false} | ||
style={customStyles} | ||
> | ||
<Text as='p' weight='bold'> | ||
Available Deriv P2P Balance | ||
</Text> | ||
<Text as='p' className='p2p-v2-block-unblock-user-modal__text' size='sm'> | ||
Your Deriv P2P balance only includes deposits that can’t be reversed. | ||
</Text> | ||
<Text as='p' className='p2p-v2-block-unblock-user-modal__text' size='sm'> | ||
Deposits via cards and the following payment methods aren’t included: Maestro, Diners Club, ZingPay, | ||
Skrill, Neteller, Ozow, and UPI QR. | ||
</Text> | ||
<div className='p2p-v2-block-unblock-user-modal__footer'> | ||
<Button onClick={onRequestClose} size='lg' textSize='sm'> | ||
Ok | ||
</Button> | ||
</div> | ||
</Modal> | ||
); | ||
}; | ||
|
||
export default AvailableP2PBalanceModal; |
1 change: 1 addition & 0 deletions
1
packages/p2p-v2/src/components/Modals/AvailableP2PBalanceModal/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 AvailableP2PBalanceModal } from './AvailableP2PBalanceModal'; |
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,3 @@ | ||
export * from './AvailableP2PBalanceModal'; | ||
export * from './DailyLimitModal'; | ||
export * from './PaymentMethods'; |
1 change: 0 additions & 1 deletion
1
packages/p2p-v2/src/components/PaymentMethodForm/PaymentMethodForm.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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export { default as useAdvertiserStats } from './useAdvertiserStats'; | ||
export { default as useDevice } from './useDevice'; | ||
export { default as usePoiPoaStatus } from './usePoiPoaStatus'; | ||
export { default as useQueryString } from './useQueryString'; | ||
export { default as useSendbird } from './useSendbird'; |
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.