Skip to content

Commit

Permalink
Merge pull request #2015 from aksonov/4.0.0-beta.8
Browse files Browse the repository at this point in the history
PR for beta.8
  • Loading branch information
aksonov authored Jul 13, 2017
2 parents 9839c1d + 7c31ed9 commit e079ec7
Show file tree
Hide file tree
Showing 14 changed files with 308 additions and 107 deletions.
8 changes: 8 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@ module.exports = {
extends: 'airbnb',
plugins: [
'react',
'jest'
],
env: {
"jest/globals": true
},
parser: 'babel-eslint',
rules: {
"jest/no-disabled-tests": "warn",
"jest/no-focused-tests": "error",
"jest/no-identical-title": "error",
"jest/valid-expect": "error",
'react/forbid-prop-types': 0,
'no-console': 0,
'new-cap': 0,
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ before_script:
- if [ $TEST_SUITE = example-jest ]; then rm -rf Example/node_modules/react-native-router-flux/Example; fi
- if [ $TEST_SUITE = example-jest ]; then cp -r src/ Example/node_modules/react-native-router-flux/src/; fi
script:
- if [ $TEST_SUITE = eslint ]; then node node_modules/eslint/bin/eslint index.js src/ test/; fi
- if [ $TEST_SUITE = eslint ]; then node node_modules/.bin/eslint index.js src/ _tests__/; fi
- if [ $TEST_SUITE = lib-test ]; then yarn test; fi
- if [ $TEST_SUITE = example-jest ]; then cd Example && yarn run jest && cd ..; fi
before_cache:
Expand Down
13 changes: 7 additions & 6 deletions Example/Example.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,17 @@ class Example extends Component {
render() {
return (
<Router createReducer={reducerCreate}>
<Scene key="lightbox" lightbox>
<Scene key="lightbox" lightbox leftButtonTextStyle={{ color: 'green' }} backButtonTextStyle={{ color:'red' }} >
<Scene key="modal" modal hideNavBar>
<Scene key="drawer" drawer contentComponent={TabView} >
<Scene key="root" hideNavBar hideTabBar>
<Scene key="echo" back clone component={EchoView} getTitle={({navigation}) => navigation.state.key}/>
<Scene key="register" back>
<Scene key="_register" component={Register} title="Register"/>
<Scene key="register2" component={Register} title="Register2"/>
<Scene key="home" component={Home} title="Replace" type='replace'/>
<Scene key="_register" component={Register} title="Register" />
<Scene key="register2" component={Register} title="Register2" />
<Scene key="home" component={Home} title="Replace" type='replace' />
</Scene>
<Scene key="launch" component={Launch} title="Launch" initial/>
<Scene key="launch" component={Launch} title="Launch" initial />
<Scene
key="tabbar"
gestureEnabled={false}
Expand Down Expand Up @@ -114,12 +114,13 @@ class Example extends Component {
</Scene>
</Scene>
</Scene>
<Scene key="login">
<Scene key="login" >
<Scene key="loginModal" component={Login} title="Login" leftTitle="Cancel" onLeft={Actions.pop}/>
<Scene
key="loginModal2"
component={Login2}
title="Login2"
backTitle="Back"
panHandlers={null}
duration={1}
/>
Expand Down
1 change: 1 addition & 0 deletions Example/components/Launch.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const styles = StyleSheet.create({

class Launch extends React.Component {
render(){
console.log("Launch RENDER");
return (
<View {...this.props} style={styles.container}>
<Text>Launch page</Text>
Expand Down
10 changes: 9 additions & 1 deletion Example/components/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,24 @@ const styles = StyleSheet.create({
});

export default class extends React.Component {
componentDidMount() {
Actions.refresh({
title: 'Login!',
rightTitle: 'rightTitle',
onRight: () => {},
});
}
render() {
const title = this.props.title || 'No Title';
const data = this.props.data || 'No Data';
console.log("Login RENDER");
return (
<View style={[styles.container, this.props.style]}>
<Text>Login page 1</Text>
<Text>Title: {title}</Text>
<Text>Data: {data}</Text>
<Button onPress={() => Actions.loginModal2({data: "Custom data2", title: "Custom title2"})}>Login 2</Button>
<Button onPress={() => Actions.refresh({title: "Changed title"})}>Change title</Button>
<Button onPress={() => Actions.refresh({title: "Changed title", data: "Changed data"})}>Change title</Button>
<Button onPress={Actions.pop}>Back</Button>
</View>
);
Expand Down
8 changes: 4 additions & 4 deletions Example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
},
"dependencies": {
"autobind-decorator": "^1.4.1",
"mobx": "^3.1.16",
"mobx": "^3.2.1",
"mobx-react": "^4.2.1",
"react": "16.0.0-alpha.6",
"react-native": "0.44.0",
"react-native-button": "^2.0.0",
"react-navigation": "^1.0.0-beta.11",
"react-native-router-flux": "^4.0.0-beta.7",
"react": "16.0.0-alpha.6",
"react-native": "0.44.0"
"react-navigation": "^1.0.0-beta.11"
},
"devDependencies": {
"babel-jest": "20.0.3",
Expand Down
Loading

0 comments on commit e079ec7

Please sign in to comment.