Commit 8b878635 authored by Wietse Kuipers's avatar Wietse Kuipers
Browse files

Fix some linting errors

parent e4795bc9
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
}, },
"extends": [ "extends": [
"eslint:recommended", "eslint:recommended",
"plugin:react/recommended" "plugin:react/recommended",
"airbnb"
], ],
"parserOptions": { "parserOptions": {
"ecmaFeatures": { "ecmaFeatures": {
...@@ -40,7 +41,9 @@ ...@@ -40,7 +41,9 @@
"react-native/no-unused-styles": 2, "react-native/no-unused-styles": 2,
"react-native/split-platform-components": 2, "react-native/split-platform-components": 2,
"react-native/no-inline-styles": 2, "react-native/no-inline-styles": 2,
"react-native/no-color-literals": 2 "react-native/no-color-literals": 2,
"react/jsx-filename-extension": 0,
"react/prefer-stateless-function": 1
} }
} }
...@@ -28,3 +28,8 @@ export default class Login extends Component { ...@@ -28,3 +28,8 @@ export default class Login extends Component {
); );
} }
} }
Login.propTypes = {
loggedIn: React.PropTypes.bool.isRequired,
login: React.PropTypes.func.isRequired,
};
...@@ -5,18 +5,26 @@ import Login from '../components/Login'; ...@@ -5,18 +5,26 @@ import Login from '../components/Login';
import * as ThaliAppActions from '../actions/ThaliAppActions'; import * as ThaliAppActions from '../actions/ThaliAppActions';
class ThaliApp extends Component { class ThaliApp extends Component {
render() { render() {
const { state, actions } = this.props; // const { state, actions } = this.props;
return ( return (
<Login <Login
loggedIn={state.loggedIn} loggedIn={this.props.state.loggedIn}
{...actions} {...this.props.actions}
/> />
); );
} }
} }
ThaliApp.propTypes = {
state: React.PropTypes.objectOf(React.PropTypes.oneOfType([
React.PropTypes.string,
React.PropTypes.bool,
React.PropTypes.number,
])).isRequired,
actions: React.PropTypes.objectOf(React.PropTypes.func).isRequired,
};
export default connect( export default connect(
state => ( state => (
{ state: state.login } { state: state.login }
......
import { import {
React, AppRegistry,
AppRegistry
} from 'react-native'; } from 'react-native';
import App from './app/containers/app'; import App from './app/containers/app';
......
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import { import {
AppRegistry, AppRegistry,
StyleSheet,
Text,
View
} from 'react-native'; } from 'react-native';
import App from './app/containers/app';
export default class ThaliApp extends Component { AppRegistry.registerComponent('ThaliApp', () => App);
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>
Welcome to React Native!
</Text>
<Text style={styles.instructions}>
To get started, edit index.ios.js
</Text>
<Text style={styles.instructions}>
Press Cmd+R to reload,{'\n'}
Cmd+D or shake for dev menu
</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
AppRegistry.registerComponent('ThaliApp', () => ThaliApp);
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
"private": true, "private": true,
"scripts": { "scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start", "start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest" "test": "jest",
"lint": "eslint *.js app --fix"
}, },
"dependencies": { "dependencies": {
"react": "~15.4.0-rc.4", "react": "~15.4.0-rc.4",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment