-
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.
yauheni/74383/ converting app.jsx in account to functional component (#…
…6282) * yauheni/74383/ converting app in account to functional component * converted to tsx with rootstore * added todo for future types implementation Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”> Co-authored-by: Matin shafiei <matin@deriv.com> Co-authored-by: Carol Sachdeva <58209918+carol-binary@users.noreply.github.com>
- Loading branch information
1 parent
82076cb
commit e1fc3e8
Showing
6 changed files
with
56 additions
and
40 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 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,28 @@ | ||
import React from 'react'; | ||
import Routes from 'Containers/routes.jsx'; | ||
import ResetTradingPassword from 'Containers/reset-trading-password.jsx'; | ||
import { MobxContentProvider } from 'Stores/connect'; | ||
import initStore from 'Stores/init-store'; | ||
import { TCoreStore } from 'Stores/index'; | ||
|
||
// TODO: add correct types for stores and WS after implementing them | ||
type TAppProps = { | ||
passthrough: { | ||
root_store: TCoreStore; | ||
WS: Record<string, any>; | ||
}; | ||
}; | ||
|
||
const App = ({ passthrough }: TAppProps) => { | ||
const { root_store, WS } = passthrough; | ||
initStore(root_store, WS); | ||
|
||
return ( | ||
<MobxContentProvider store={root_store}> | ||
<Routes /> | ||
<ResetTradingPassword /> | ||
</MobxContentProvider> | ||
); | ||
}; | ||
|
||
export default App; |
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,26 @@ | ||
export type TCoreStore = { | ||
client: Record<string, any>; | ||
common: Record<string, any>; | ||
ui: Record<string, any>; | ||
gtm: Record<string, any>; | ||
rudderstack: Record<string, any>; | ||
pushwoosh: Record<string, any>; | ||
}; | ||
|
||
export default class RootStore { | ||
public client: Record<string, any>; | ||
public common: Record<string, any>; | ||
public ui: Record<string, any>; | ||
public gtm: Record<string, any>; | ||
public rudderstack: Record<string, any>; | ||
public pushwoosh: Record<string, any>; | ||
|
||
constructor(core_store: TCoreStore) { | ||
this.client = core_store.client; | ||
this.common = core_store.common; | ||
this.ui = core_store.ui; | ||
this.gtm = core_store.gtm; | ||
this.rudderstack = core_store.rudderstack; | ||
this.pushwoosh = core_store.pushwoosh; | ||
} | ||
} |
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