Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
16 changes: 12 additions & 4 deletions app/components/App/App.js
Original file line number Diff line number Diff line change
@@ -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) => (
<Page style={{display: 'flex', flexDirection: 'column'}}>
<AppBar app={app} />
<div style={{flexGrow: 2}}>

<div style={{flexShrink: 0}}>
<AppBar app={app} />
</div>
<div style={{flexGrow: 2, overflow: 'auto'}}>
<SwipeableViews>
<div>
<Info app={app} />
</div>
</SwipeableViews>
</div>
<AppBottomBar app={app} />
</Page>
Expand Down
77 changes: 0 additions & 77 deletions app/components/App/App2.js

This file was deleted.

19 changes: 11 additions & 8 deletions app/components/ReactNative/Info.js
Original file line number Diff line number Diff line change
@@ -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);
};
Expand All @@ -33,6 +33,9 @@ class Info extends PureComponent {
/>
</div>
))}
{!this.props.info && (
<CircularProgress />
)}
</CardText>
</Card>
<Card>
Expand All @@ -46,10 +49,10 @@ class Info extends PureComponent {
{Boolean(this.props.info) && map(keys(this.props.info.packages), key => (
<div key={key}>
<TextField
disabled
hintText={this.props.info.packages[key].wanted}
defaultValue={this.props.info.packages[key].installed}
disabled
floatingLabelText={`${key} (wanted: ${this.props.info.packages[key].wanted})`}
hintText={this.props.info.packages[key].wanted}
/>
</div>
))}
Expand Down
23 changes: 23 additions & 0 deletions app/components/ReactNative/Info.js.flow
Original file line number Diff line number Diff line change
@@ -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;