on df0c310 help sign in
bridge/src/views/Activate/ActivateMasterKey.tsx
38 lines 1.0 kB history raw
1import { LocalRouterProvider, useLocalRouter } from 'lib/LocalRouter';
3import useRouter from 'lib/useRouter';
5import MasterKeyDownload from './MasterKeyDownload';
6import MasterKeyTransfer from './MasterKeyTransfer';
7import MasterKeyReveal from './MasterKeyReveal';
8import MasterKeyConfirm from './MasterKeyConfirm';
10const NAMES = {
11 REVEAL: 'REVEAL',
12 DOWNLOAD: 'DOWNLOAD',
13 CONFIRM: 'CONFIRM',
14 TRANSFER: 'TRANSFER',
15};
17const VIEWS = {
18 [NAMES.REVEAL]: MasterKeyReveal,
19 [NAMES.DOWNLOAD]: MasterKeyDownload,
20 [NAMES.CONFIRM]: MasterKeyConfirm,
21 [NAMES.TRANSFER]: MasterKeyTransfer,
22};
24export default function ActivateMasterKey() {
25 // pull the reset function out of the 'activate' router
26 const { reset: resetActivateRouter }: any = useLocalRouter();
27 const { Route, ...router }: any = useRouter({
28 names: NAMES,
29 views: VIEWS,
30 initialRoutes: [{ key: NAMES.REVEAL }],
31 });
33 return (
34 <LocalRouterProvider value={router}>
35 <Route resetActivateRouter={resetActivateRouter} />
36 </LocalRouterProvider>
37 );