Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1. "use strict";
  2.  
  3. import React, { AppRegistry } from 'react-native';
  4. import App from './components/App';
  5.  
  6. AppRegistry.registerComponent('ReactNativeProject', () => App);
  7.  
  8. 'use strict'
  9.  
  10. import React, {Component} from 'react';
  11. import {
  12. AppRegistry,
  13. StyleSheet,
  14. NavigatorIOS,
  15. } from 'react-native';
  16. var Login = require('./Login');
  17.  
  18. class App extends Component {
  19. render() {
  20. return (
  21. <NavigatorIOS
  22. style={styles.navigationContainer}
  23. initialRoute={{
  24. title: "Login Page",
  25. component: Login,
  26. }} />
  27. );
  28. }
  29. }
  30.  
  31. var styles = StyleSheet.create({
  32. navigationContainer: {
  33. flex: 1
  34. }
  35. });
  36.  
  37. export default App;
  38.  
  39. **Login.js** (ReactNativeProject/components/Login.js)
  40.  
  41. "use strict";
  42. import React, {Component} from 'react';
  43. import {
  44. StyleSheet,
  45. Text,
  46. TextInput
  47. } from 'react-native';
  48. import Button from 'react-native-button';
  49. import styles from './login';
  50.  
  51.  
  52. class Login extends Component {
  53.  
  54. constructor(props) {
  55. super(props);
  56. this.state = {
  57. username: "",
  58. password: "",
  59.  
  60. };
  61. }
  62.  
  63. render() {
  64. return (
  65.  
  66. <View style={styles.container}>
  67. <View style={styles.textContainer}>
  68. <TextInput
  69. style={styles.inputUsername}
  70. placeholder="Enter email ID"
  71. value={this.state.username}
  72. clearButtonMode = 'while-editing'/>
  73. <TextInput
  74. style={styles.inputPassword}
  75. placeholder="Enter Password"
  76. value={this.state.password}
  77. password={true}
  78. secureTextEntry={true}
  79. clearButtonMode = 'while-editing' />
  80.  
  81. <Button style={styles.login}
  82. styleDisabled={{color: 'red'}}>
  83. Login
  84. </Button>
  85. </View>
  86. </View>
  87. );
  88. }
  89.  
  90. module.exports = Login;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement