|
1 | 1 | import*asReactfrom'react' |
2 | 2 |
|
3 | | -importCondfrom'./components/Cond' |
4 | | -importLoadingfrom'./components/Loading' |
| 3 | +importRouterfrom'./components/Router' |
| 4 | +importLoadingPagefrom'./containers/LoadingPage' |
5 | 5 | importContinuePagefrom'./containers/Continue' |
6 | 6 | importNewPagefrom'./containers/New' |
7 | 7 | importTutorialPagefrom'./containers/Tutorial' |
8 | 8 |
|
| 9 | +const{ Route}=Router |
| 10 | + |
9 | 11 | interfaceProps{ |
10 | 12 | state:any |
11 | 13 | } |
@@ -37,21 +39,22 @@ const Routes = ({ state }: Props) => { |
37 | 39 | } |
38 | 40 | }) |
39 | 41 |
|
40 | | -// TODO: refactor cond to user <Router><Route> and accept first route as if/else if |
41 | 42 | return( |
42 | 43 | <divstyle={{ ...styles.page, ...dimensions}}> |
43 | | -<Condstate={state}path="SelectTutorial.Startup"> |
44 | | -<Loading/> |
45 | | -</Cond> |
46 | | -<Condstate={state}path="SelectTutorial.NewTutorial"> |
47 | | -<NewPage/> |
48 | | -</Cond> |
49 | | -<Condstate={state}path="SelectTutorial.ContinueTutorial"> |
50 | | -<ContinuePage/> |
51 | | -</Cond> |
52 | | -<Condstate={state}path="Tutorial"> |
53 | | -<TutorialPagestate={state}/> |
54 | | -</Cond> |
| 44 | +<Routerstate={state}> |
| 45 | +<Routepath="SelectTutorial.Startup"> |
| 46 | +<LoadingPagetext="Launching..."/> |
| 47 | +</Route> |
| 48 | +<Routepath="SelectTutorial.NewTutorial"> |
| 49 | +<NewPage/> |
| 50 | +</Route> |
| 51 | +<Routepath="SelectTutorial.ContinueTutorial"> |
| 52 | +<ContinuePage/> |
| 53 | +</Route> |
| 54 | +<Routepath="Tutorial"> |
| 55 | +<TutorialPagestate={state}/> |
| 56 | +</Route> |
| 57 | +</Router> |
55 | 58 | </div> |
56 | 59 | ) |
57 | 60 | } |
|