Commit 16995295 by Georgina Mondino

Primer Commit

0 parents
{
"f9155ac790fd02fadcdeca367b02581c04a353aa6d5aa84409a59f6804c87acd": true,
"89ed26367cdb9b771858e026f2eb95bfdb90e5ae943e716575327ec325f39c44": true
}
\ No newline at end of file \ No newline at end of file
node_modules/**/*
.expo/*
npm-debug.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision
*.orig.*
web-build/
web-report/
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import UserNavigation from "./app/navigations/user";
export default function App() {
return (
<View style={styles.container}>
<UserNavigation/>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
});
{
"expo": {
"name": "5-Tenedores",
"slug": "5-Tenedores",
"privacy": "public",
"sdkVersion": "34.0.0",
"platforms": [
"ios",
"android",
"web"
],
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true
}
}
}
\ No newline at end of file \ No newline at end of file
import React from "react";
import t from "tcomb-form-native";
import formValidation from "../utils/validation.js";
import inputTemplate from "./templates/input.js";
export const RegisterStruct = t.struct ({
name: t.String,
email:formValidation.email,
password: formValidation.password,
passwordConfirmation: formValidation.password
});
export const RegisterOptions ={
fields:{
name:{
label:"Nombre (*)",
placeHolder: "Nombre(s) y Apellido(s)",
error: "Nombre Invalido"
},
email:{
label: "Email(*)",
placeHolder: "TuEmail@Algo.com",
error:"Email Invalido",
},
password:{
label:"Constraseña (*)",
placeHolder:"Constraseña",
error: "Contraseña Invalida",
password:true,
secureTextEntry: true
},
passwordConfirmation:{
label: "Repetir Contraseña (*)",
placeHolder: "Constraseña",
error: "Contraseña Invalida",
password:true,
secureTextEntry: true
}
}
}
\ No newline at end of file \ No newline at end of file
import React from "react-native";
import {StyleSheet, View} from "react-native";
import {Input, Icon} from "react-native-elements";
export default (inputTemplate = locals => {
return (
<View>
<Input placeholder= "Texto"
/>
</View>
);
});
const styles =StyleSheet.create({});
\ No newline at end of file \ No newline at end of file
import React from "react";
import { Icon } from 'react-native-elements'
import {
createStackNavigator,
createAppContainer,
createBottomTabNavigator
} from "react-navigation";
//Screens
import HomeScreen from "../screens/home";
import TopFiveScreen from "../screens/topfive";
import SearchScreen from "../screens/search";
import MyAccountScreen from "../screens/myAccount/myaccount";
import RegisterScreen from "../screens/myAccount/register";
const HomeScreenStack = createStackNavigator({
Home: {
screen: HomeScreen,
navigationOptions: ({ navigation }) => ({
title:"Home"
})
}
});
const TopFiveScreenStack = createStackNavigator({
TopFive: {
screen: TopFiveScreen,
navigationOptions: ({ navigation }) => ({
title:"Top 5 Restaurantes"
})
}
});
const SearchScreenStack = createStackNavigator({
Search: {
screen: SearchScreen,
navigationOptions: ({ navigation }) => ({
title:"Buscar"
})
}
});
const MyAccountScreenStack = createStackNavigator({
MyAccount: {
screen: MyAccountScreen,
navigationOptions: ({ navigation }) => ({
title:"Mi Perfil"
})
},
Register: {
screen: RegisterScreen,
navigationOptions: ({navigation}) => ({
title: "Sign In"
})
}
});
const RootStack = createBottomTabNavigator ({
Home: {
screen: HomeScreenStack,
navigationOptions : ({ navigation }) => ({
tabBarLabel: "Home",
tabBarIcon: ({ tintColor}) => (
<Icon
name='home'
color={tintColor}/>
)
})
},
TopFive: {
screen: TopFiveScreenStack,
navigationOptions : ({ navigation})=>({
tabBarLabel: "Top 5 Restaurantes",
tabBarIcon: ({ tintColor}) => (
<Icon
name='grade'
color={tintColor}/>
)
})
},
Search: {
screen: SearchScreenStack,
navigationOptions : ({ navigation})=>({
tabBarLabel: "Buscar",
tabBarIcon: ({ tintColor}) => (
<Icon
name='search'
color={tintColor}/>
)
})
},
TopFive: {
screen: TopFiveScreenStack,
navigationOptions : ({ navigation})=>({
tabBarLabel: "Top 5 Restaurantes",
tabBarIcon: ({ tintColor}) => (
<Icon
name='grade'
color={tintColor}/>
)
})
},
MyAccount: {
screen: MyAccountScreenStack,
navigationOptions : ({ navigation})=>({
tabBarLabel: "Mi Perfil",
tabBarIcon: ({ tintColor}) => (
<Icon
name='face'
color={tintColor}/>
)
})
}
},
{
initialRouteName: "MyAccount",
order: ["Home", "TopFive", "Search", "MyAccount"]
}
);
export default createAppContainer (RootStack);
\ No newline at end of file \ No newline at end of file
import React, {Component} from "react";
import { StyleSheet, View, Text } from 'react-native'
export default class Home extends Component {
render(){
return (
<View style={styles.viewBody}>
<Text >Home Screen</Text>
</View>
)
}
}
const styles = StyleSheet.create ({
viewBody : {
flex:1,
backgroundColor: '#fff',
alignItems:'center',
justifyContent:'center',
}
})
\ No newline at end of file \ No newline at end of file
import React, {Component} from "react";
import { StyleSheet, View, Text } from "react-native";
import {Button} from "react-native-elements";
export default class MyAccount extends Component {
goToScreen = nameScreen => {
this.props.navigation.navigate(nameScreen)
};
render(){
return (
<View style={styles.viewBody}>
<Text>Mi Perfil</Text>
<Button title="Sign In"onPress={() => this.goToScreen("Register")} ></Button>
</View>
)
}
}
const styles = StyleSheet.create ({
viewBody : {
flex:1,
backgroundColor: '#fff',
alignItems:'center',
justifyContent:'center',
}
})
\ No newline at end of file \ No newline at end of file
import React, {Component} from "react";
import { StyleSheet, View, Text } from 'react-native'
import t from "tcomb-form-native";
const Form = t.form.Form;
import {RegisterStruct, RegisterOptions} from "../../forms/register";
import {Button} from "react-native-elements";
export default class Register extends Component {
constructor (){
super();
this.state = {
formData:{
name: "",
email: "",
password: "",
passwordConfirmation: ""
}
};
}
register = () => {
const {password, passwordConfirmation} = this.state.formData;
if (password === passwordConfirmation){
const validate = this.refs.registerForm.getValue();
if (validate) {
console.log ("Formulario Correcto");
}
else console.log ("Formulario Invvalido");
}
else console.log ("Las contrasenas no son iguales");
};
onChangeFormRegister = (formValue) => {
this.setState({
formData: formValue
});
console.log(this.state.formData);
}
render(){
return (
<View style={styles.viewBody}>
<Form
ref="registerForm"
type={RegisterStruct}
options={RegisterOptions}
value= {this.state.formData}
onChange= {(formValue) => this.onChangeFormRegister(formValue)}
/>
<Button title="Unirse" onPress= {() =>this.register() }/>
</View>
);
}
}
const styles = StyleSheet.create ({
viewBody : {
flex:1,
marginLeft:40,
marginRight:40,
justifyContent:'center'
}
})
\ No newline at end of file \ No newline at end of file
import React, {Component} from "react";
import { StyleSheet, View, Text } from 'react-native'
export default class Search extends Component {
render(){
return (
<View style={styles.viewBody}>
<Text>Buscar</Text>
</View>
)
}
}
const styles = StyleSheet.create ({
viewBody : {
flex:1,
backgroundColor: '#fff',
alignItems:'center',
justifyContent:'center',
}
})
\ No newline at end of file \ No newline at end of file
import React, {Component} from "react";
import { StyleSheet, View, Text } from 'react-native'
export default class TopFive extends Component {
render(){
return (
<View style={styles.viewBody}>
<Text>Top 5 Restaurantes</Text>
</View>
)
}
}
const styles = StyleSheet.create ({
viewBody : {
flex:1,
backgroundColor: '#fff',
alignItems:'center',
justifyContent:'center',
}
})
\ No newline at end of file \ No newline at end of file
import t from "tcomb-form-native";
export default (formValidation = {
email: t.refinement (t.String, value =>{
return /@/.test(value);
}),
password: t.refinement (t.String, (value) =>{
return value.length >=6;
})
});
\ No newline at end of file \ No newline at end of file
module.exports = function(api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
};
};
This diff could not be displayed because it is too large.
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"expo": "^34.0.1",
"react": "16.8.3",
"react-dom": "^16.8.6",
"react-native": "https://github.com/expo/react-native/archive/sdk-34.0.0.tar.gz",
"react-native-elements": "^1.1.0",
"react-native-gesture-handler": "^1.3.0",
"react-native-reanimated": "^1.1.0",
"react-native-vector-icons": "^6.6.0",
"react-native-web": "^0.11.4",
"react-navigation": "^3.12.1",
"tcomb-form-native": "^0.6.20"
},
"devDependencies": {
"babel-preset-expo": "^6.0.0"
},
"private": true
}
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!