Advertisement
raulghm

U3 Artículo1 SE2

Feb 17th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React from 'react';
  2. import {
  3.  Text, View, Button, TextInput,
  4. } from 'react-native';
  5.  
  6. import Card from './Card';
  7. import CardSection from './CardSection';
  8.  
  9. export default class AddTodo extends React.Component {
  10.   constructor(props) {
  11.     super(props);
  12.     this.state = {
  13.       title: '',
  14.       value: '',
  15.       error: '',
  16.     };
  17.   }
  18.  
  19.   render() {
  20.     return (
  21.       <Card>
  22.         <CardSection>
  23.           <View>
  24.             <Text>Title</Text>
  25.             <TextInput
  26.               placeholder="title"
  27.               autoCorrect={false}
  28.               value={this.state.title}
  29.               onChangeText={title => this.setState({ title })}
  30.             />
  31.           </View>
  32.         </CardSection>
  33.         <CardSection>
  34.           <View>
  35.             <Text>Detail</Text>
  36.             <TextInput
  37.               placeholder="detail"
  38.               autoCorrect={false}
  39.               value={this.state.detail}
  40.               onChangeText={detail => this.setState({ detail })}
  41.             />
  42.           </View>
  43.         </CardSection>
  44.  
  45.         <CardSection>
  46.           <View style={{ flex: 1, marginRight: 10 }}>
  47.             <Button title="Completar" onPress={() => console.log('click')} />
  48.           </View>
  49.           <View style={{ flex: 1 }}>
  50.             <Button title="Cerrar" onPress={() => console.log('click')} />
  51.           </View>
  52.         </CardSection>
  53.       </Card>
  54.     );
  55.   }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement