From 9d4b7d4eb1226e144bdf169dcc7064c83a3ed0cd Mon Sep 17 00:00:00 2001 From: co2-git Date: Sun, 15 Apr 2018 12:58:48 +0100 Subject: [PATCH] Fix #18 --- .flowconfig | 1 + app/components/App/App.js | 16 +++-- app/components/App/App2.js | 77 ------------------------- app/components/ReactNative/Info.js | 19 +++--- app/components/ReactNative/Info.js.flow | 23 ++++++++ 5 files changed, 47 insertions(+), 89 deletions(-) delete mode 100644 app/components/App/App2.js create mode 100644 app/components/ReactNative/Info.js.flow diff --git a/.flowconfig b/.flowconfig index 6858a13..25e46b0 100644 --- a/.flowconfig +++ b/.flowconfig @@ -21,6 +21,7 @@ ./app/components/Layout/Open.js.flow ./app/components/Layout/Page.js.flow ./app/components/Layout/Router.js.flow +./app/components/ReactNative/Info.js.flow ./app/components/Terminal/Console.js.flow [options] diff --git a/app/components/App/App.js b/app/components/App/App.js index 4953351..ac5fffb 100644 --- a/app/components/App/App.js +++ b/app/components/App/App.js @@ -1,15 +1,23 @@ // @flow import React from 'react'; +import SwipeableViews from 'react-swipeable-views'; import AppBar from './AppBar'; -import Page from '../Layout/Page'; import AppBottomBar from './AppBottomBar'; +import Info from '../ReactNative/Info'; +import Page from '../Layout/Page'; const App = ({app}: $AppProps) => ( - -
- +
+ +
+
+ +
+ +
+
diff --git a/app/components/App/App2.js b/app/components/App/App2.js deleted file mode 100644 index c039fca..0000000 --- a/app/components/App/App2.js +++ /dev/null @@ -1,77 +0,0 @@ -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}) => ( -
- - - - )} - onLeftIconButtonClick={() => Router.get('main').go('index')} - iconElementRight={( - - )} - onItemClick={(event, child) => Router.get(app.path).go(child.props.primaryText)} - > - - - - - - - - )} - /> - - - - - - - - - - - - - - - - - - - - -
-); - -export default App; diff --git a/app/components/ReactNative/Info.js b/app/components/ReactNative/Info.js index 23cf45f..ea50ead 100644 --- a/app/components/ReactNative/Info.js +++ b/app/components/ReactNative/Info.js @@ -1,15 +1,15 @@ -import React, {PureComponent} from 'react'; +// @flow import {Card, CardHeader, CardText} from 'material-ui/Card'; -import map from 'lodash/map'; +import {connect} from 'react-redux'; +import CircularProgress from 'material-ui/CircularProgress'; import keys from 'lodash/keys'; +import map from 'lodash/map'; +import React, {PureComponent} from 'react'; import TextField from 'material-ui/TextField'; -import {connect} from 'react-redux'; -import get from 'lodash/get'; -import exec from '../../lib/exec'; import {getInfo} from '../../redux/actions/infoActions'; -class Info extends PureComponent { +class Info extends PureComponent<$InfoProps> { componentDidMount = () => { getInfo(this.props.app); }; @@ -33,6 +33,9 @@ class Info extends PureComponent { />
))} + {!this.props.info && ( + + )} @@ -46,10 +49,10 @@ class Info extends PureComponent { {Boolean(this.props.info) && map(keys(this.props.info.packages), key => (
))} diff --git a/app/components/ReactNative/Info.js.flow b/app/components/ReactNative/Info.js.flow new file mode 100644 index 0000000..00c1580 --- /dev/null +++ b/app/components/ReactNative/Info.js.flow @@ -0,0 +1,23 @@ +// @flow + +declare type $InfoOwnProps = {| + +app: $App, +|}; + +declare type $InfoConnectProps = {| + +info: {| + +environment: {| + [key: string]: string, + |}, + +packages: {| + [package: string]: {| + +installed: string, + +wanted: string, + |}, + |}, + |}, +|}; + +declare type $InfoProps = + & $InfoOwnProps + & InfoConnectProps;