Skip to content

Instantly share code, notes, and snippets.

@alaingoldman
Last active August 11, 2017 22:42
Show Gist options
  • Save alaingoldman/ab0b822a8f8430ef50d1b0bb422d0604 to your computer and use it in GitHub Desktop.
Save alaingoldman/ab0b822a8f8430ef50d1b0bb422d0604 to your computer and use it in GitHub Desktop.
renderScene(route, navigator){
return <route.component navigator={navigator} />
}
render(){
return(
<Navigator
initialRoute={{component: RamNavigation}}
renderScene={this.renderScene.bind(this)} />
)
}
linker(comp){
this.props.navigator.push({
component: comp
})
}
<TextInput style={styles.ramInput}
onChangeText={(password) => this.setState({password})}
placeholder={"Enter password"}
secureTextEntry={true}
color={"white"}
placeholderTextColor={"#CCC"}
/>
@SaraBereket
Copy link

import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
TouchableHighlight,
navigator,
} from 'react-native';

import Register from './Register';
import Forgot from './Forgot';

export default class Login extends Component {
linker(comp){
this.props.navigator.push({
Component:comp
})
}

render() {
return (


Login

    <TouchableHighlight onPress={this.linker.bind(this, Register)}>
      <View style={styles.box}>
        <Text style={styles.textlogin}>
        Click here to register
        </Text>
      </View>
    </TouchableHighlight> 

     <TouchableHighlight onPress={this.linker.bind(this, Forgot)}>
      <View style={styles.box}>
        <Text style={styles.textlogin}>
        Forgot login            
        </Text>
      </View>
    </TouchableHighlight> 

  </View>
);

}
}

const styles = StyleSheet.create({
textlogin:{
color:"white",
alignSelf:"center",
fontSize:20,
fontWeight:"500",
color:"cyan",
},

box:{
height:45,
width:300,
backgroundColor:"black",
justifyContent:"center",
marginTop:10,

},

container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 40,
textAlign: 'center',
margin: 10,
marginBottom: 20,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});

@SaraBereket
Copy link

import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
Navigator,
} from 'react-native';
import Login from "./Login";

export default class parknpay extends Component {

renderScene(route, navigator){
return <route.component navigator={navigator} />
}

render(){
  return(
    <Navigator
      initialRoute={{component: Login}}
      renderScene={this.renderScene.bind(this)} />
      )
    }

}

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('parknpay', () => parknpay);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment