Skip to content

Instantly share code, notes, and snippets.

import React, { Component } from 'react';
import { View, Text } from 'react-native';
import { Card, CardItem, Button, Item, Label, Input } from 'native-base';
class AddACard extends Component {
constructor(props) {
super(props);
this.state = {
cardValue: '',//<--- Nuevo
cards: [] //<--- Nuevo
}
import React, { Component } from 'react';
import { View, Text } from 'react-native';
import { Card, CardItem, Button, Item, Label, Input } from 'native-base';
class AddACard extends Component {
constructor(props) {
super(props);
this.state = {
cardValue: '',
cards: []
}
import React, { Component } from 'react';
import { View,Text } from 'react-native';
class Training extends Component {
constructor(props) {
super(props);
this.state = { }
}
render() {
return ( <View>
import { createStackNavigator, createAppContainer } from "react-navigation";
import AddACard from "./src/components/UI/AddACard";
import Training from "./src/components/UI/Training";
const AppNavigator = createStackNavigator({
AddACard: {
screen: AddACard
},
Training :{
screen:Training
import React from 'react';
import { StyleSheet, View } from 'react-native';
import Router from './Router';//<-- se añade esta importación
export default function App() {
return (
<Router/> //<se llama el Router
);
}
import React, { Component } from 'react';
import { View, Text } from 'react-native';
import { Card, CardItem, Button, Item, Label, Input } from 'native-base';
class AddACard extends Component {
constructor(props) {
super(props);
this.state = {
cardValue: '',
cards: []
}
import React, { Component } from 'react';
import { View, Text } from 'react-native';
import { Card, CardItem, Button, Item, Label, Input } from 'native-base';
class AddACard extends Component {
constructor(props) {
super(props);
this.state = {
cardValue: '',
cards: []
}
import React, { Component } from 'react';
import { View, Text } from 'react-native';
import { Card, CardItem, Button } from 'native-base';
class Training extends Component {
//nuevo
static navigationOptions = ({ navigation }) => {
return {
title: 'Repaso'
}
const mongoose = require('mongoose')
const Schema = mongoose.Schema;
const categorySchema=new Schema({
name: String,
icon: {
name: String,
type: String
}
})
var express = require('express');
var router = express.Router();
const Category = require('../models/category')
//index and form to create
router.get('/', async function (req, res, next) {
console.log('index')
categories = await Category.find();
res.render('categories/index', { title: 'Tarjeta APP', categories: categories , query:req.query });
});
//create