Skip to content

Commit 33d7a57

Browse files
authored
Merge pull request #20 from co2-git/feature/18
Fix #18
2 parents 961f165 + 9d4b7d4 commit 33d7a57

File tree

5 files changed

+47
-89
lines changed

5 files changed

+47
-89
lines changed

.flowconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
./app/components/Layout/Open.js.flow
2222
./app/components/Layout/Page.js.flow
2323
./app/components/Layout/Router.js.flow
24+
./app/components/ReactNative/Info.js.flow
2425
./app/components/Terminal/Console.js.flow
2526

2627
[options]

app/components/App/App.js

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

45
import AppBar from './AppBar';
5-
import Page from '../Layout/Page';
66
import AppBottomBar from './AppBottomBar';
7+
import Info from '../ReactNative/Info';
8+
import Page from '../Layout/Page';
79

810
const App = ({app}: $AppProps) => (
911
<Page style={{display: 'flex', flexDirection: 'column'}}>
10-
<AppBar app={app} />
11-
<div style={{flexGrow: 2}}>
12-
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>
1321
</div>
1422
<AppBottomBar app={app} />
1523
</Page>

app/components/App/App2.js

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

app/components/ReactNative/Info.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import React, {PureComponent} from 'react';
1+
// @flow
22
import {Card, CardHeader, CardText} from 'material-ui/Card';
3-
import map from 'lodash/map';
3+
import {connect} from 'react-redux';
4+
import CircularProgress from 'material-ui/CircularProgress';
45
import keys from 'lodash/keys';
6+
import map from 'lodash/map';
7+
import React, {PureComponent} from 'react';
58
import TextField from 'material-ui/TextField';
6-
import {connect} from 'react-redux';
7-
import get from 'lodash/get';
89

9-
import exec from '../../lib/exec';
1010
import {getInfo} from '../../redux/actions/infoActions';
1111

12-
class Info extends PureComponent {
12+
class Info extends PureComponent<$InfoProps> {
1313
componentDidMount = () => {
1414
getInfo(this.props.app);
1515
};
@@ -33,6 +33,9 @@ class Info extends PureComponent {
3333
/>
3434
</div>
3535
))}
36+
{!this.props.info && (
37+
<CircularProgress />
38+
)}
3639
</CardText>
3740
</Card>
3841
<Card>
@@ -46,10 +49,10 @@ class Info extends PureComponent {
4649
{Boolean(this.props.info) && map(keys(this.props.info.packages), key => (
4750
<div key={key}>
4851
<TextField
49-
disabled
50-
hintText={this.props.info.packages[key].wanted}
5152
defaultValue={this.props.info.packages[key].installed}
53+
disabled
5254
floatingLabelText={`${key} (wanted: ${this.props.info.packages[key].wanted})`}
55+
hintText={this.props.info.packages[key].wanted}
5356
/>
5457
</div>
5558
))}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// @flow
2+
3+
declare type $InfoOwnProps = {|
4+
+app: $App,
5+
|};
6+
7+
declare type $InfoConnectProps = {|
8+
+info: {|
9+
+environment: {|
10+
[key: string]: string,
11+
|},
12+
+packages: {|
13+
[package: string]: {|
14+
+installed: string,
15+
+wanted: string,
16+
|},
17+
|},
18+
|},
19+
|};
20+
21+
declare type $InfoProps =
22+
& $InfoOwnProps
23+
& InfoConnectProps;

0 commit comments

Comments
 (0)