Skip to content

Instantly share code, notes, and snippets.

View NavizDev's full-sized avatar

Juan Silupu Maza NavizDev

View GitHub Profile
NavizDev / useAuthFirebase.js
Created April 14, 2020 14:30
hook para manejar firebase en toda la app
import React, { useState, useEffect, useContext, createContext } from "react";
import firebase from "firebase/app";
import "firebase/auth";
import firebaseConfig from "../firebase/firebaseConfig";
if (firebase.apps.length === 0) {
const authContext = createContext();
import { useState, useEffect } from "react";
const useForm = ({ initialValues }) => {
const [fields, setFields] = useState(initialValues);
const onChange = event => {
const { value, name } =;
setFields({ ...fields, [name]: value });
NavizDev / ListSedes.js
Last active December 14, 2019 01:54
Lista de Sedes y Subsedes. Cada Sede tiene subsedes, y esta sede le pertenece a un Cliente.
import React from 'react';
import { Collapse, Icon, Select } from 'antd';
import { Form, Input, Button, message } from 'antd';
import AddItemInput from './AddItemInput'
import ListSubStation from './ListSubStation'
import SaveLocationForm from './SaveLocationForm'
import ClientService from '../../../clientService'
const { Panel } = Collapse;
NavizDev / index.html
Created October 10, 2019 05:16
Ng-Change vs $watch
<html> <div ng-app="myApp" ng-controller="myController">
<input ng-model=""></input>
<select id="typeperson" ng-model="person.typeperson" ng-change="changetypedocument()">
<option ng-repeat="item in typeperson" value="{{}}">{{}}</option>
<select name="typedocument" id="typedocument" ng-model="person.typedocument" >
<option ng-repeat="item in typedocument" value="{{}}">{{}}
<button ng-click="load()">Cargar</button>