Skip to content

Commit 84ff847

Browse files
authored
Merge pull request #23 from co2-git/v0.1.4
V0.1.4
2 parents 4c7df79 + c89d381 commit 84ff847

Some content is hidden

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

85 files changed

+868
-409
lines changed

.flowconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,27 @@
66
; Ignore polyfills
77
.*/Libraries/polyfills/.*
88

9+
; Ignore relase
10+
.*/release/.*
11+
912

1013
[include]
1114

1215
[libs]
1316
./flow/app.js.flow
1417
./app/components/App/App.js.flow
1518
./app/components/App/AppBar.js.flow
19+
./app/components/Base/Animated.js.flow
20+
./app/components/FlexBox/Flex.js.flow
1621
./app/components/Layout/AppCard.js.flow
1722
./app/components/Layout/Header.js.flow
1823
./app/components/Layout/Home.js.flow
1924
./app/components/Layout/Init.js.flow
2025
./app/components/Layout/Layout.js.flow
2126
./app/components/Layout/Open.js.flow
27+
./app/components/Layout/Page.js.flow
2228
./app/components/Layout/Router.js.flow
29+
./app/components/ReactNative/Info.js.flow
2330
./app/components/Terminal/Console.js.flow
2431

2532
[options]

app/App.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,13 @@ const Loading = () => (
1212
<div>Loading</div>
1313
);
1414

15+
const persistor = persistStore(store);
16+
17+
// persistor.purge();
18+
1519
const App = () => (
1620
<Provider store={store}>
17-
<PersistGate loading={<Loading />} persistor={persistStore(store)}>
21+
<PersistGate loading={<Loading />} persistor={persistor}>
1822
<Layout />
1923
</PersistGate>
2024
</Provider>

app/components/App/App.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
11
// @flow
22
import React from 'react';
3+
import SwipeableViews from 'react-swipeable-views';
34

45
import AppBar from './AppBar';
6+
import AppBottomBar from './AppBottomBar';
7+
import Info from '../ReactNative/Info';
58
import Page from '../Layout/Page';
69

710
const App = ({app}: $AppProps) => (
8-
<Page>
9-
<AppBar app={app} />
11+
<Page style={{display: 'flex', flexDirection: 'column'}}>
12+
<div style={{flexShrink: 0}}>
13+
<AppBar app={app} />
14+
</div>
15+
<div style={{flexGrow: 2, overflow: 'auto'}}>
16+
<SwipeableViews>
17+
<div>
18+
<Info app={app} />
19+
</div>
20+
</SwipeableViews>
21+
</div>
22+
<AppBottomBar app={app} />
1023
</Page>
1124
);
1225

app/components/App/App2.js

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

app/components/App/AppBar.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// @flow
2-
import DropDownIcon from 'material-ui/svg-icons/navigation/arrow-drop-down';
32
import IconButton from 'material-ui/IconButton';
4-
import IconMenu from 'material-ui/IconMenu';
53
import MaterialUIAppBar from 'material-ui/AppBar';
6-
import MenuItem from 'material-ui/MenuItem';
74
import NavigationBack from 'material-ui/svg-icons/navigation/arrow-back';
85
import path from 'path';
96
import React from 'react';
@@ -19,21 +16,6 @@ const AppBar = ({app}: $AppBarProps) => (
1916
</IconButton>
2017
)}
2118
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-
)}
3719
/>
3820
);
3921

app/components/App/AppBottomBar.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// @flow
2+
import React from 'react';
3+
import {BottomNavigation, BottomNavigationItem} from 'material-ui/BottomNavigation';
4+
import Paper from 'material-ui/Paper';
5+
import PlayIcon from 'material-ui/svg-icons/av/play-arrow';
6+
import EjectIcon from 'material-ui/svg-icons/action/eject';
7+
import InfoIcon from 'material-ui/svg-icons/action/info';
8+
import AndroidIcon from 'material-ui/svg-icons/action/android';
9+
import UpgradeIcon from 'material-ui/svg-icons/notification/system-update';
10+
import SmartPhoneIcon from 'material-ui/svg-icons/hardware/smartphone';
11+
12+
const AppBottomBar = () => (
13+
<Paper zDepth={1}>
14+
<BottomNavigation>
15+
<BottomNavigationItem
16+
label="Info"
17+
onClick={() => {}}
18+
icon={<InfoIcon />}
19+
/>
20+
<BottomNavigationItem
21+
label="Start"
22+
onClick={() => {}}
23+
icon={<PlayIcon />}
24+
/>
25+
<BottomNavigationItem
26+
label="Android"
27+
onClick={() => {}}
28+
icon={<AndroidIcon />}
29+
/>
30+
<BottomNavigationItem
31+
label="iOS"
32+
onClick={() => {}}
33+
icon={<i className="icon-apple" style={{fontSize: 24, color: '#777', marginTop: -3}} />}
34+
/>
35+
<BottomNavigationItem
36+
label="Upgrade"
37+
onClick={() => {}}
38+
icon={<UpgradeIcon />}
39+
/>
40+
<BottomNavigationItem
41+
label="Native"
42+
onClick={() => {}}
43+
icon={<SmartPhoneIcon />}
44+
/>
45+
<BottomNavigationItem
46+
label="Eject"
47+
onClick={() => {}}
48+
icon={<EjectIcon />}
49+
/>
50+
</BottomNavigation>
51+
</Paper>
52+
);
53+
54+
export default AppBottomBar;

app/components/Base/Animated.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// @flow
12
import React from 'react';
23
import omit from 'lodash/omit';
34

@@ -80,7 +81,7 @@ const effects = [
8081
'slideOutUp',
8182
];
8283

83-
const Animated = (props) => {
84+
const Animated = (props: $AnimatedProps) => {
8485
const names = ['animated'];
8586
const remove = [];
8687
for (const effect of effects) {
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// @flow
2+
3+
declare type $AnimatedReactProps = {
4+
+children?: any,
5+
};
6+
7+
declare type $AnimatedProps =
8+
& $AnimatedReactProps;

app/components/FlexBox/Flex.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1+
// @flow
12
import React from 'react';
23

3-
type $FlexProps = {
4-
children: any,
5-
};
6-
74
const makeStyle = (props: $FlexProps) => {
85
const {style: propsStyle = {}} = props;
96
const style = {...propsStyle, display: 'flex', flexDirection: 'row'};
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// @flow
2+
3+
type $FlexDirection =
4+
& 'column'
5+
& 'row';
6+
7+
declare type $FlexReactProps = {
8+
children: any,
9+
style?: Object,
10+
};
11+
12+
declare type $FlexOwnProps = {|
13+
+between?: boolean,
14+
+column?: boolean,
15+
+direction?: $FlexDirection,
16+
+flexDirection?: $FlexDirection,
17+
+row?: boolean,
18+
|};
19+
20+
declare type $FlexProps =
21+
& $FlexReactProps
22+
& $FlexOwnProps;

0 commit comments

Comments
 (0)