Skip to content

Instantly share code, notes, and snippets.

@jqed-xuereb
Created August 30, 2017 08:56
Show Gist options
  • Save jqed-xuereb/adb25968cfe09158abd350f458f72e4d to your computer and use it in GitHub Desktop.
Save jqed-xuereb/adb25968cfe09158abd350f458f72e4d to your computer and use it in GitHub Desktop.
import React from 'react';
import ReactNative from 'react-native';
import { AppRegistry,Text,View,Button,} from 'react-native';
import { StackNavigator } from 'react-navigation'
import fieldValues from './registration'
import NameFields from './namefields'
class AccountFields extends React.Component{
static navigtionOptions= {
title: "Let's make an account",
}
render() {
return (
<div>
<h2>Account Details</h2>
<ul className="form-fields">
<li>
<label>Email</label>
<input type="email" ref="email" defaultValue={this.state.fieldValues.email} />
</li>
<li>
<label>Password</label>
<input type="password" ref="password" defaultValue={this.state.fieldValues.password} />
</li>
<li className="form-footer">
<button className="btn -primary pull-right" onClick={this.nextStep}>Save &amp; Continue</button>
</li>
</ul>
</div>
);
nextStep: function handleEvent(e) {
e.preventDefault()
var data = {
email : this.refs.email.getDOMNode().value,
password : this.refs.password.getDOMNode().value,
}
this.props.saveValues(data)
this.props.nextStep()
}
}
render() {
const { navigate } = this.props.navigation;
return(
<View>
<Text></Text>
<Button
onPress={()=> navigate('NameFields')}
title="Next"
/>
</View>
);
}
}
const App = StackNavigator({
AccountFields: { screen: AccountFields},
NameFields: {screen: NameFields},
});
module.exports = AccountFields
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment