-
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] P2P Ako/ add p2p-v2 base layout (#13173)
* ci: add nx cache dir to the gitignore * build: update ui lib * feat: add app content tab * feat: use app content in app module * feat: add p2p routes to router module * build: update package-lock json file
- Loading branch information
1 parent
054804b
commit 9ca2dbc
Showing
10 changed files
with
36,656 additions
and
26,871 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 |
---|---|---|
|
@@ -27,3 +27,4 @@ nx-cloud.env | |
test-results/ | ||
playwright-report/ | ||
playwright/.cache/ | ||
.nx |
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
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,11 +1,15 @@ | ||
import React from 'react'; | ||
import { APIProvider } from '@deriv/api'; | ||
import AppContent from './routes/AppContent'; | ||
import { Router } from './routes'; | ||
import './index.scss'; | ||
|
||
const App: React.FC = () => ( | ||
<APIProvider standalone> | ||
<Router /> | ||
</APIProvider> | ||
); | ||
const App: React.FC = () => { | ||
return ( | ||
<APIProvider standalone> | ||
<Router /> | ||
<AppContent /> | ||
</APIProvider> | ||
); | ||
}; | ||
export default App; |
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 @@ | ||
.p2p-v2-tab { | ||
&__items-wrapper { | ||
& button { | ||
padding: 0 3rem; | ||
white-space: nowrap; | ||
height: 40px; | ||
@include mobile { | ||
width: calc(100vw / 4); | ||
} | ||
} | ||
} | ||
&__wrapper { | ||
width: fit-content; | ||
@include mobile { | ||
width: 100vw; | ||
margin-top: 4rem; | ||
} | ||
} | ||
} |
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,50 @@ | ||
import React from 'react'; | ||
import { useHistory } from 'react-router-dom'; | ||
import { useActiveAccount } from '@deriv/api'; | ||
import { Loader } from '@deriv-com/ui/dist/components/Loader'; | ||
import { Tab, Tabs } from '@deriv-com/ui/dist/components/Tabs'; | ||
import { MobileCloseHeader } from '../../components'; | ||
import { useDevice } from '../../hooks'; | ||
import './index.scss'; | ||
|
||
export const routesConfiguration = [ | ||
{ Component: <div> Buy Sell Page </div>, path: 'buy-sell', title: 'Buy / Sell' }, | ||
{ Component: <div> Orders Page </div>, path: 'orders', title: 'Orders' }, | ||
{ Component: <div> My Ads Page </div>, path: 'my-ads', title: 'My Ads' }, | ||
{ Component: <div> My Profile Page </div>, path: 'my-profile', title: 'My Profile' }, | ||
]; | ||
const AppContent = () => { | ||
const history = useHistory(); | ||
const { data: activeAccountData, isLoading } = useActiveAccount(); | ||
const { isMobile } = useDevice(); | ||
if (isLoading || !activeAccountData) return <Loader color='#85acb0' />; | ||
|
||
// NOTE: Replace this with P2PBlocked component later and a custom hook useIsP2PEnabled, P2P is only available for USD accounts | ||
if (activeAccountData?.currency !== 'USD') return <h1>P2P is only available for USD accounts.</h1>; | ||
|
||
return ( | ||
<> | ||
{isMobile && <MobileCloseHeader />} | ||
<div className='p2p-v2-tab__wrapper'> | ||
<Tabs | ||
className='p2p-v2-tab__items-wrapper' | ||
onChange={index => { | ||
history.push(`/cashier/p2p-v2/${routesConfiguration[index].path}`); | ||
}} | ||
variant='secondary' | ||
wrapperClassName='p2p-v2-tab__wrapper' | ||
> | ||
{routesConfiguration.map(({ Component, path, title }) => { | ||
return ( | ||
<Tab key={path} title={title}> | ||
{Component} | ||
</Tab> | ||
); | ||
})} | ||
</Tabs> | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default AppContent; |
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
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
9ca2dbc
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.binary.sx
deriv-app-git-master.binary.sx
binary.sx