-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from co2-git/develop
Develop
- Loading branch information
Showing
46 changed files
with
588 additions
and
633 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 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 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 |
---|---|---|
@@ -1,77 +1,13 @@ | ||
import {Column, Row} from 'reactors-flex'; | ||
import {Dimensions, Text, View} from 'reactors'; | ||
import AppBar from 'material-ui/AppBar'; | ||
import DropDownIcon from 'material-ui/svg-icons/navigation/arrow-drop-down'; | ||
import Icon from 'reactors-icons'; | ||
import IconButton from 'material-ui/IconButton'; | ||
import IconMenu from 'material-ui/IconMenu'; | ||
import MenuItem from 'material-ui/MenuItem'; | ||
import NavigationBack from 'material-ui/svg-icons/navigation/arrow-back'; | ||
import path from 'path'; | ||
import RaisedButton from 'material-ui/RaisedButton'; | ||
// @flow | ||
import React from 'react'; | ||
import Router from 'reactors-router'; | ||
import Packager from '../Packager/Home'; | ||
import ReactNative from '../ReactNative/Home'; | ||
import Android from '../Android/Home'; | ||
import IOS from '../IOS/Home'; | ||
import Expo from '../Expo/Home'; | ||
import NativeModules from '../NativeModules/Home'; | ||
|
||
import Commands from './Commands'; | ||
import Init from '../Command/Init'; | ||
import AppBar from './AppBar'; | ||
import Page from '../Layout/Page'; | ||
|
||
const App = ({app}) => ( | ||
<section> | ||
<AppBar | ||
title={path.basename(app.path)} | ||
iconElementLeft={( | ||
<IconButton> | ||
<NavigationBack /> | ||
</IconButton> | ||
)} | ||
onLeftIconButtonClick={() => Router.get('main').go('index')} | ||
iconElementRight={( | ||
<IconMenu | ||
iconButtonElement={( | ||
<IconButton><DropDownIcon /></IconButton> | ||
)} | ||
onItemClick={(event, child) => Router.get(app.path).go(child.props.primaryText)} | ||
> | ||
<MenuItem primaryText="Packager" /> | ||
<MenuItem primaryText="React Native" /> | ||
<MenuItem primaryText="Android" /> | ||
<MenuItem primaryText="iOS" /> | ||
<MenuItem primaryText="Expo" /> | ||
<MenuItem primaryText="Native modules" /> | ||
</IconMenu> | ||
)} | ||
/> | ||
<Router | ||
name={app.path} | ||
width={Dimensions.get('window').width} | ||
height={Dimensions.get('window').height - 80} | ||
> | ||
<Router.Route name="Packager"> | ||
<Packager app={app} /> | ||
</Router.Route> | ||
<Router.Route name="React Native"> | ||
<ReactNative app={app} /> | ||
</Router.Route> | ||
<Router.Route name="Android"> | ||
<Android app={app} /> | ||
</Router.Route> | ||
<Router.Route name="iOS"> | ||
<IOS app={app} /> | ||
</Router.Route> | ||
<Router.Route name="Expo"> | ||
<Expo app={app} /> | ||
</Router.Route> | ||
<Router.Route name="Native modules"> | ||
<NativeModules app={app} /> | ||
</Router.Route> | ||
</Router> | ||
</section> | ||
const App = ({app}: $AppProps) => ( | ||
<Page> | ||
<AppBar app={app} /> | ||
</Page> | ||
); | ||
|
||
export default App; |
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,8 @@ | ||
// @flow | ||
|
||
declare type $AppOwnProps = {| | ||
+app: $App, | ||
|}; | ||
|
||
declare type $AppProps = | ||
& $AppOwnProps; |
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,77 @@ | ||
import {Column, Row} from 'reactors-flex'; | ||
import {Dimensions, Text, View} from 'reactors'; | ||
import AppBar from 'material-ui/AppBar'; | ||
import DropDownIcon from 'material-ui/svg-icons/navigation/arrow-drop-down'; | ||
import Icon from 'reactors-icons'; | ||
import IconButton from 'material-ui/IconButton'; | ||
import IconMenu from 'material-ui/IconMenu'; | ||
import MenuItem from 'material-ui/MenuItem'; | ||
import NavigationBack from 'material-ui/svg-icons/navigation/arrow-back'; | ||
import path from 'path'; | ||
import RaisedButton from 'material-ui/RaisedButton'; | ||
import React from 'react'; | ||
import Router from 'reactors-router'; | ||
import Packager from '../Packager/Home'; | ||
import ReactNative from '../ReactNative/Home'; | ||
import Android from '../Android/Home'; | ||
import IOS from '../IOS/Home'; | ||
import Expo from '../Expo/Home'; | ||
import NativeModules from '../NativeModules/Home'; | ||
|
||
import Commands from './Commands'; | ||
import Init from '../Command/Init'; | ||
|
||
const App = ({app}) => ( | ||
<section> | ||
<AppBar | ||
title={path.basename(app.path)} | ||
iconElementLeft={( | ||
<IconButton> | ||
<NavigationBack /> | ||
</IconButton> | ||
)} | ||
onLeftIconButtonClick={() => Router.get('main').go('index')} | ||
iconElementRight={( | ||
<IconMenu | ||
iconButtonElement={( | ||
<IconButton><DropDownIcon /></IconButton> | ||
)} | ||
onItemClick={(event, child) => Router.get(app.path).go(child.props.primaryText)} | ||
> | ||
<MenuItem primaryText="Packager" /> | ||
<MenuItem primaryText="React Native" /> | ||
<MenuItem primaryText="Android" /> | ||
<MenuItem primaryText="iOS" /> | ||
<MenuItem primaryText="Expo" /> | ||
<MenuItem primaryText="Native modules" /> | ||
</IconMenu> | ||
)} | ||
/> | ||
<Router | ||
name={app.path} | ||
width={Dimensions.get('window').width} | ||
height={Dimensions.get('window').height - 80} | ||
> | ||
<Router.Route name="Packager"> | ||
<Packager app={app} /> | ||
</Router.Route> | ||
<Router.Route name="React Native"> | ||
<ReactNative app={app} /> | ||
</Router.Route> | ||
<Router.Route name="Android"> | ||
<Android app={app} /> | ||
</Router.Route> | ||
<Router.Route name="iOS"> | ||
<IOS app={app} /> | ||
</Router.Route> | ||
<Router.Route name="Expo"> | ||
<Expo app={app} /> | ||
</Router.Route> | ||
<Router.Route name="Native modules"> | ||
<NativeModules app={app} /> | ||
</Router.Route> | ||
</Router> | ||
</section> | ||
); | ||
|
||
export default App; |
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,40 @@ | ||
// @flow | ||
import DropDownIcon from 'material-ui/svg-icons/navigation/arrow-drop-down'; | ||
import IconButton from 'material-ui/IconButton'; | ||
import IconMenu from 'material-ui/IconMenu'; | ||
import MaterialUIAppBar from 'material-ui/AppBar'; | ||
import MenuItem from 'material-ui/MenuItem'; | ||
import NavigationBack from 'material-ui/svg-icons/navigation/arrow-back'; | ||
import path from 'path'; | ||
import React from 'react'; | ||
|
||
import {switchRoute} from '../../redux/actions/routerActions'; | ||
|
||
const AppBar = ({app}: $AppBarProps) => ( | ||
<MaterialUIAppBar | ||
title={path.basename(app.path)} | ||
iconElementLeft={( | ||
<IconButton> | ||
<NavigationBack /> | ||
</IconButton> | ||
)} | ||
onLeftIconButtonClick={() => switchRoute(0)} | ||
iconElementRight={( | ||
<IconMenu | ||
iconButtonElement={( | ||
<IconButton><DropDownIcon /></IconButton> | ||
)} | ||
onItemClick={(event, child) => console.log(child.props.primaryText)} | ||
> | ||
<MenuItem primaryText="Packager" /> | ||
<MenuItem primaryText="React Native" /> | ||
<MenuItem primaryText="Android" /> | ||
<MenuItem primaryText="iOS" /> | ||
<MenuItem primaryText="Expo" /> | ||
<MenuItem primaryText="Native modules" /> | ||
</IconMenu> | ||
)} | ||
/> | ||
); | ||
|
||
export default AppBar; |
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,8 @@ | ||
// @flow | ||
|
||
declare type $AppBarOwnProps = {| | ||
+app: $App, | ||
|}; | ||
|
||
declare type $AppBarProps = | ||
& $AppBarOwnProps; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.