-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Farzin/Putting wallet behind feature flag [WIP] (#9362)
* refactor(appstore): 🔥 clean-up * refactor(appstore): 🔥 clean-up * refactor(appstore): 🔥 clean-up * refactor(appstore): 🔥 clean-up * refactor(appstore): 🔥 clean-up * refactor(appstore): 🔥 clean-up * refactor(appstore): 🔥 clean-up * refactor(appstore): 🔥 clean-up * refactor(appstore): 🔥 clean-up * refactor(appstore): 🔥 clean-up * refactor(appstore): 🔥 clean-up * refactor(appstore): 🔥 clean-up * refactor(appstore): 🔥 clean-up * refactor(appstore): 🔥 clean-up * refactor(appstore): 🔥 clean-up * refactor(appstore): 🔥 clean-up --------- Co-authored-by: Farzin Mirzaie <farzin@deriv.com>
- Loading branch information
1 parent
991f643
commit e47979e
Showing
35 changed files
with
473 additions
and
518 deletions.
There are no files selected for viewing
12 changes: 8 additions & 4 deletions
12
packages/appstore/src/components/add-more-wallets/add-more-wallets.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React from 'react'; | ||
import { routes } from '@deriv/shared'; | ||
import { observer, useStore } from '@deriv/stores'; | ||
import Routes from 'Components/routes/routes'; | ||
import classNames from 'classnames'; | ||
import './app.scss'; | ||
|
||
const AppContent: React.FC = observer(() => { | ||
const { ui } = useStore(); | ||
|
||
return ( | ||
<main | ||
className={classNames('dashboard', { | ||
'theme--light': !ui.is_dark_mode_on, | ||
'theme--dark': ui.is_dark_mode_on, | ||
'dashboard-onboarding': window.location.pathname === routes.onboarding, | ||
})} | ||
> | ||
<div className='dw-dashboard'> | ||
<Routes /> | ||
</div> | ||
</main> | ||
); | ||
}); | ||
|
||
export default AppContent; |
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,45 +1,24 @@ | ||
import classNames from 'classnames'; | ||
import * as React from 'react'; | ||
import { setWebsocket, routes } from '@deriv/shared'; | ||
import { StoreProvider, observer } from '@deriv/stores'; | ||
import React from 'react'; | ||
import CashierStoreProvider from '@deriv/cashier/src/cashier-providers'; | ||
import CFDStoreProvider from '@deriv/cfd/src/cfd-providers'; | ||
import Routes from 'Components/routes/routes'; | ||
import { useStores, initContext } from 'Stores'; | ||
import { TRootStore } from 'Types'; | ||
import { StoreProvider } from '@deriv/stores'; | ||
import AppContent from './app-content'; | ||
import './app.scss'; | ||
|
||
type TAppProps = { | ||
type TProps = { | ||
passthrough: { | ||
root_store: TRootStore; | ||
WS: Record<string, any>; | ||
root_store: React.ComponentProps<typeof StoreProvider>['store']; | ||
}; | ||
}; | ||
|
||
const App = ({ passthrough: { WS, root_store } }: TAppProps) => { | ||
initContext(root_store, WS); | ||
setWebsocket(WS); | ||
const { ui }: TRootStore = useStores(); | ||
const App: React.FC<TProps> = ({ passthrough: { root_store } }) => ( | ||
<CashierStoreProvider store={root_store}> | ||
<CFDStoreProvider store={root_store}> | ||
<StoreProvider store={root_store}> | ||
<AppContent /> | ||
</StoreProvider> | ||
</CFDStoreProvider> | ||
</CashierStoreProvider> | ||
); | ||
|
||
return ( | ||
<CashierStoreProvider store={root_store as any}> | ||
<CFDStoreProvider store={root_store as any}> | ||
<StoreProvider store={root_store as any}> | ||
<main | ||
className={classNames('dashboard', { | ||
'theme--light': !ui.is_dark_mode_on, | ||
'theme--dark': ui.is_dark_mode_on, | ||
'dashboard-onboarding': window.location.pathname === routes.onboarding, | ||
})} | ||
> | ||
<div className='dw-dashboard'> | ||
<Routes /> | ||
</div> | ||
</main> | ||
</StoreProvider> | ||
</CFDStoreProvider> | ||
</CashierStoreProvider> | ||
); | ||
}; | ||
|
||
export default observer(App); | ||
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
16 changes: 0 additions & 16 deletions
16
packages/appstore/src/components/routes/routes-wrapper.tsx
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
Oops, something went wrong.