Skip to content

Commit 93f625d

Browse files
authored
Merge pull request #14 from co2-git/develop
Develop
2 parents 6082e75 + c8797fb commit 93f625d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+588
-633
lines changed

.flowconfig

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,17 @@
1010
[include]
1111

1212
[libs]
13-
/flow/*.flow.js
13+
./flow/app.js.flow
14+
./app/components/App/App.js.flow
15+
./app/components/App/AppBar.js.flow
16+
./app/components/Layout/AppCard.js.flow
17+
./app/components/Layout/Header.js.flow
18+
./app/components/Layout/Home.js.flow
19+
./app/components/Layout/Init.js.flow
20+
./app/components/Layout/Layout.js.flow
21+
./app/components/Layout/Open.js.flow
22+
./app/components/Layout/Router.js.flow
23+
./app/components/Terminal/Console.js.flow
1424

1525
[options]
1626
emoji=true
@@ -36,7 +46,5 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*
3646
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
3747
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
3848

39-
unsafe.enable_getters_and_setters=true
40-
4149
[version]
4250
^0.69.0

app/App.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {Provider} from 'react-redux';
55
import React from 'react';
66
import {persistStore} from 'redux-persist';
77

8-
import Router from './components/Layout/Router';
8+
import Layout from './components/Layout/Layout';
99
import store from './redux/store';
1010

1111
const Loading = () => (
@@ -15,7 +15,7 @@ const Loading = () => (
1515
const App = () => (
1616
<Provider store={store}>
1717
<PersistGate loading={<Loading />} persistor={persistStore(store)}>
18-
<Router />
18+
<Layout />
1919
</PersistGate>
2020
</Provider>
2121
);

app/components/App/App.js

Lines changed: 7 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,13 @@
1-
import {Column, Row} from 'reactors-flex';
2-
import {Dimensions, Text, View} from 'reactors';
3-
import AppBar from 'material-ui/AppBar';
4-
import DropDownIcon from 'material-ui/svg-icons/navigation/arrow-drop-down';
5-
import Icon from 'reactors-icons';
6-
import IconButton from 'material-ui/IconButton';
7-
import IconMenu from 'material-ui/IconMenu';
8-
import MenuItem from 'material-ui/MenuItem';
9-
import NavigationBack from 'material-ui/svg-icons/navigation/arrow-back';
10-
import path from 'path';
11-
import RaisedButton from 'material-ui/RaisedButton';
1+
// @flow
122
import React from 'react';
13-
import Router from 'reactors-router';
14-
import Packager from '../Packager/Home';
15-
import ReactNative from '../ReactNative/Home';
16-
import Android from '../Android/Home';
17-
import IOS from '../IOS/Home';
18-
import Expo from '../Expo/Home';
19-
import NativeModules from '../NativeModules/Home';
203

21-
import Commands from './Commands';
22-
import Init from '../Command/Init';
4+
import AppBar from './AppBar';
5+
import Page from '../Layout/Page';
236

24-
const App = ({app}) => (
25-
<section>
26-
<AppBar
27-
title={path.basename(app.path)}
28-
iconElementLeft={(
29-
<IconButton>
30-
<NavigationBack />
31-
</IconButton>
32-
)}
33-
onLeftIconButtonClick={() => Router.get('main').go('index')}
34-
iconElementRight={(
35-
<IconMenu
36-
iconButtonElement={(
37-
<IconButton><DropDownIcon /></IconButton>
38-
)}
39-
onItemClick={(event, child) => Router.get(app.path).go(child.props.primaryText)}
40-
>
41-
<MenuItem primaryText="Packager" />
42-
<MenuItem primaryText="React Native" />
43-
<MenuItem primaryText="Android" />
44-
<MenuItem primaryText="iOS" />
45-
<MenuItem primaryText="Expo" />
46-
<MenuItem primaryText="Native modules" />
47-
</IconMenu>
48-
)}
49-
/>
50-
<Router
51-
name={app.path}
52-
width={Dimensions.get('window').width}
53-
height={Dimensions.get('window').height - 80}
54-
>
55-
<Router.Route name="Packager">
56-
<Packager app={app} />
57-
</Router.Route>
58-
<Router.Route name="React Native">
59-
<ReactNative app={app} />
60-
</Router.Route>
61-
<Router.Route name="Android">
62-
<Android app={app} />
63-
</Router.Route>
64-
<Router.Route name="iOS">
65-
<IOS app={app} />
66-
</Router.Route>
67-
<Router.Route name="Expo">
68-
<Expo app={app} />
69-
</Router.Route>
70-
<Router.Route name="Native modules">
71-
<NativeModules app={app} />
72-
</Router.Route>
73-
</Router>
74-
</section>
7+
const App = ({app}: $AppProps) => (
8+
<Page>
9+
<AppBar app={app} />
10+
</Page>
7511
);
7612

7713
export default App;

app/components/App/App.js.flow

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// @flow
2+
3+
declare type $AppOwnProps = {|
4+
+app: $App,
5+
|};
6+
7+
declare type $AppProps =
8+
& $AppOwnProps;

app/components/App/App2.js

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import {Column, Row} from 'reactors-flex';
2+
import {Dimensions, Text, View} from 'reactors';
3+
import AppBar from 'material-ui/AppBar';
4+
import DropDownIcon from 'material-ui/svg-icons/navigation/arrow-drop-down';
5+
import Icon from 'reactors-icons';
6+
import IconButton from 'material-ui/IconButton';
7+
import IconMenu from 'material-ui/IconMenu';
8+
import MenuItem from 'material-ui/MenuItem';
9+
import NavigationBack from 'material-ui/svg-icons/navigation/arrow-back';
10+
import path from 'path';
11+
import RaisedButton from 'material-ui/RaisedButton';
12+
import React from 'react';
13+
import Router from 'reactors-router';
14+
import Packager from '../Packager/Home';
15+
import ReactNative from '../ReactNative/Home';
16+
import Android from '../Android/Home';
17+
import IOS from '../IOS/Home';
18+
import Expo from '../Expo/Home';
19+
import NativeModules from '../NativeModules/Home';
20+
21+
import Commands from './Commands';
22+
import Init from '../Command/Init';
23+
24+
const App = ({app}) => (
25+
<section>
26+
<AppBar
27+
title={path.basename(app.path)}
28+
iconElementLeft={(
29+
<IconButton>
30+
<NavigationBack />
31+
</IconButton>
32+
)}
33+
onLeftIconButtonClick={() => Router.get('main').go('index')}
34+
iconElementRight={(
35+
<IconMenu
36+
iconButtonElement={(
37+
<IconButton><DropDownIcon /></IconButton>
38+
)}
39+
onItemClick={(event, child) => Router.get(app.path).go(child.props.primaryText)}
40+
>
41+
<MenuItem primaryText="Packager" />
42+
<MenuItem primaryText="React Native" />
43+
<MenuItem primaryText="Android" />
44+
<MenuItem primaryText="iOS" />
45+
<MenuItem primaryText="Expo" />
46+
<MenuItem primaryText="Native modules" />
47+
</IconMenu>
48+
)}
49+
/>
50+
<Router
51+
name={app.path}
52+
width={Dimensions.get('window').width}
53+
height={Dimensions.get('window').height - 80}
54+
>
55+
<Router.Route name="Packager">
56+
<Packager app={app} />
57+
</Router.Route>
58+
<Router.Route name="React Native">
59+
<ReactNative app={app} />
60+
</Router.Route>
61+
<Router.Route name="Android">
62+
<Android app={app} />
63+
</Router.Route>
64+
<Router.Route name="iOS">
65+
<IOS app={app} />
66+
</Router.Route>
67+
<Router.Route name="Expo">
68+
<Expo app={app} />
69+
</Router.Route>
70+
<Router.Route name="Native modules">
71+
<NativeModules app={app} />
72+
</Router.Route>
73+
</Router>
74+
</section>
75+
);
76+
77+
export default App;

app/components/App/AppBar.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// @flow
2+
import DropDownIcon from 'material-ui/svg-icons/navigation/arrow-drop-down';
3+
import IconButton from 'material-ui/IconButton';
4+
import IconMenu from 'material-ui/IconMenu';
5+
import MaterialUIAppBar from 'material-ui/AppBar';
6+
import MenuItem from 'material-ui/MenuItem';
7+
import NavigationBack from 'material-ui/svg-icons/navigation/arrow-back';
8+
import path from 'path';
9+
import React from 'react';
10+
11+
import {switchRoute} from '../../redux/actions/routerActions';
12+
13+
const AppBar = ({app}: $AppBarProps) => (
14+
<MaterialUIAppBar
15+
title={path.basename(app.path)}
16+
iconElementLeft={(
17+
<IconButton>
18+
<NavigationBack />
19+
</IconButton>
20+
)}
21+
onLeftIconButtonClick={() => switchRoute(0)}
22+
iconElementRight={(
23+
<IconMenu
24+
iconButtonElement={(
25+
<IconButton><DropDownIcon /></IconButton>
26+
)}
27+
onItemClick={(event, child) => console.log(child.props.primaryText)}
28+
>
29+
<MenuItem primaryText="Packager" />
30+
<MenuItem primaryText="React Native" />
31+
<MenuItem primaryText="Android" />
32+
<MenuItem primaryText="iOS" />
33+
<MenuItem primaryText="Expo" />
34+
<MenuItem primaryText="Native modules" />
35+
</IconMenu>
36+
)}
37+
/>
38+
);
39+
40+
export default AppBar;

app/components/App/AppBar.js.flow

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// @flow
2+
3+
declare type $AppBarOwnProps = {|
4+
+app: $App,
5+
|};
6+
7+
declare type $AppBarProps =
8+
& $AppBarOwnProps;

app/components/App/AppName.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

app/components/App/AppTabLink.js

Lines changed: 0 additions & 34 deletions
This file was deleted.

app/components/App/AppsBar.js

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)