Skip to content

Instantly share code, notes, and snippets.

View vmacarios's full-sized avatar

Victor Macarios vmacarios

View GitHub Profile
@vmacarios
vmacarios / To-do
Last active November 30, 2019 20:47
Initial code for React Native ToDo app
import React, { Component } from 'react';
import { StyleSheet, Text, View } from 'react-native';
export default class App extends Component {
render() {
return (
);
}
}
@vmacarios
vmacarios / To-do
Last active November 30, 2019 20:49
Adding some color
import React, { Component } from 'react';
import { StyleSheet, Text, View, StatusBar } from 'react-native';
import { LinearGradient } from 'expo-linear-gradient';
export default class App extends Component {
render() {
return (
<LinearGradient colors={['#004e92', '#000428']} style={{ flex: 1 }}>
<StatusBar barStyle='light-content' />
</LinearGradient>
@vmacarios
vmacarios / To-do
Last active November 30, 2019 20:50
Creating and styling the Text Input
import React, { Component } from 'react';
import { StyleSheet, Text, View, StatusBar, TextInput } from 'react-native';
import { LinearGradient } from 'expo-linear-gradient';
export default class App extends Component {
render() {
return (
<LinearGradient colors={['#004e92', '#000428']} style={{ flex: 1 }}>
<StatusBar barStyle='light-content' />
<View>
@vmacarios
vmacarios / To-do
Last active November 30, 2019 20:50
Default empty value
import React, { Component } from 'react';
import { StyleSheet, Text, View, StatusBar, TextInput } from 'react-native';
import { LinearGradient } from 'expo-linear-gradient';
export default class App extends Component {
state = {
inputValue: ''
}
@vmacarios
vmacarios / To-do
Last active November 30, 2019 20:50
Update inputValue with TextInput value
import React, { Component } from 'react';
import { StyleSheet, Text, View, StatusBar, TextInput } from 'react-native';
import { LinearGradient } from 'expo-linear-gradient';
export default class App extends Component {
state = {
inputValue: ''
}
@vmacarios
vmacarios / Todo-App.js
Last active December 13, 2019 22:12
Showing the list of saved itens when hitting "done"
import React, { Component } from 'react';
import { StyleSheet, Text, View, StatusBar, TextInput, TouchableOpacity } from 'react-native';
import { LinearGradient } from 'expo-linear-gradient';
export default class App extends Component {
state = {
inputValue: '',
todos: []
}
@vmacarios
vmacarios / To-do
Created December 1, 2019 14:34
Swipeable list
import React, { Component } from 'react';
import { StyleSheet, Text, View, StatusBar, TextInput, TouchableOpacity, TouchableHighlight } from 'react-native';
import { LinearGradient } from 'expo-linear-gradient';
import Swipeable from 'react-native-swipeable-row';
export default class App extends Component {
state = {
inputValue: '',
todos: []
@vmacarios
vmacarios / Todo-App.js
Last active December 12, 2019 02:57
Styling the swipeable button
import React, { Component } from 'react';
import { StyleSheet, Text, View, StatusBar, TextInput, TouchableOpacity, TouchableHighlight } from 'react-native';
import { LinearGradient } from 'expo-linear-gradient';
import Swipeable from 'react-native-swipeable-row';
export default class App extends Component {
state = {...}
changeText = value => { ... }
addItem = () => { ... }