SHARE
TWEET

U6 art01 SE01

raulghm Feb 19th, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React from 'react';
  2. import { View, Button } from 'react-native';
  3.  
  4. import Card from './Card';
  5. import CardSection from './CardSection';
  6.  
  7. const t = require('tcomb-form-native');
  8.  
  9. const { Form } = t.form;
  10.  
  11. const todoForm = t.struct({
  12.   title: t.String,
  13.   text: t.maybe(t.String),
  14. });
  15.  
  16. const options = {};
  17.  
  18. export default class Login extends React.Component {
  19.   login() {
  20.     this.onSubmit();
  21.   }
  22.  
  23.   fingerPrint() {
  24.     this.onSubmit();
  25.   }
  26.  
  27.   render() {
  28.     return (
  29.       <Card>
  30.         <CardSection>
  31.           <Form ref="form" type={todoForm} options={options} />
  32.         </CardSection>
  33.         <CardSection>
  34.           <View style={{ flex: 1, marginRight: 10 }}>
  35.             <Button title="Login" onPress={() => this.props.navigation.navigate('TodoApp')} />
  36.           </View>
  37.           <View style={{ flex: 1 }}>
  38.             <Button title="Fingerprint" onPress={this.fingerPrint.bind(this)} />
  39.           </View>
  40.         </CardSection>
  41.       </Card>
  42.     );
  43.   }
  44. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top