Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React from 'react';
- import { View, Button } from 'react-native';
- import Card from './Card';
- import CardSection from './CardSection';
- const t = require('tcomb-form-native');
- const { Form } = t.form;
- const todoForm = t.struct({
- title: t.String,
- text: t.maybe(t.String),
- });
- const options = {};
- export default class Login extends React.Component {
- login() {
- this.onSubmit();
- }
- fingerPrint() {
- this.onSubmit();
- }
- render() {
- return (
- <Card>
- <CardSection>
- <Form ref="form" type={todoForm} options={options} />
- </CardSection>
- <CardSection>
- <View style={{ flex: 1, marginRight: 10 }}>
- <Button title="Login" onPress={() => this.props.navigation.navigate('TodoApp')} />
- </View>
- <View style={{ flex: 1 }}>
- <Button title="Fingerprint" onPress={this.fingerPrint.bind(this)} />
- </View>
- </CardSection>
- </Card>
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement