From fc85e0b6da749ba14cd127c95092b8ed8be0d88d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriela=20G=C3=B3mez=20Hern=C3=A1ndez?= Date: Wed, 27 Apr 2022 10:00:27 -0500 Subject: [PATCH] =?UTF-8?q?correcci=C3=B3n=20file=20input?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/administrador/admin.js | 34 ++++++++++++++++++ components/layouts/header.js | 10 +----- components/layouts/layout.js | 1 - components/layouts/layoutSalir.js | 19 ++++++++++ components/login/login.js | 11 +++--- components/profesores_registro/invitado.js | 12 +++---- components/profesores_registro/profesores.js | 27 ++++++-------- pages/admin.js | 37 ++++++++++++-------- pages/operador.js | 11 ++---- pages/profesores.js | 2 ++ pages/registro-exitoso.js | 13 +++---- styles/default.module.css | 16 ++++++++- 12 files changed, 120 insertions(+), 73 deletions(-) create mode 100644 components/administrador/admin.js create mode 100644 components/layouts/layoutSalir.js diff --git a/components/administrador/admin.js b/components/administrador/admin.js new file mode 100644 index 0000000..24ef5d7 --- /dev/null +++ b/components/administrador/admin.js @@ -0,0 +1,34 @@ + +import React, { useState } from 'react'; +import {Form,Button} from "react-bootstrap"; + + +function fileValidation(){ + var fileInput = document.getElementById('file'); + var filePath = fileInput.value; + var allowedExtensions = /(.csv)$/i; + if(!allowedExtensions.exec(filePath)){ + alert('Please upload file having extensions .csv only.'); + fileInput.value = ''; + return false; + } +} + + + +function SubirArchivo(){ + + return( +
+ + fileValidation()}/> + +

+ +

+
+ ); +} +export default SubirArchivo; \ No newline at end of file diff --git a/components/layouts/header.js b/components/layouts/header.js index 7579773..5cc2282 100644 --- a/components/layouts/header.js +++ b/components/layouts/header.js @@ -10,15 +10,7 @@ function Header() {
- ) } -export default Header; -/* - - - - - - */ \ No newline at end of file +export default Header; \ No newline at end of file diff --git a/components/layouts/layout.js b/components/layouts/layout.js index 28f4957..dc64013 100644 --- a/components/layouts/layout.js +++ b/components/layouts/layout.js @@ -6,7 +6,6 @@ import Footer from "./footer"; const Layout = (props) => (
-
diff --git a/components/layouts/layoutSalir.js b/components/layouts/layoutSalir.js new file mode 100644 index 0000000..75e9007 --- /dev/null +++ b/components/layouts/layoutSalir.js @@ -0,0 +1,19 @@ +import styles from "../../styles/default.module.css"; +import { Container, Row, Col,Stack,Button } from "react-bootstrap"; +function Salir(){ + return( +
+ + +
+ + + +
+
+
+
+ ); +} + +export default Salir; \ No newline at end of file diff --git a/components/login/login.js b/components/login/login.js index c608b91..9383b18 100644 --- a/components/login/login.js +++ b/components/login/login.js @@ -5,12 +5,11 @@ import {FormGroup, Label, Input} from "reactstrap"; import styles from "../../styles/login.module.css"; function App() { - const[radio, setRadio] = useState("profesor"); + const[radio, setRadio] = useState(""); const cambioRadio=e=>{ setRadio(e.target.value); } - return ( @@ -32,7 +31,6 @@ function App() { Profesor/a - - { if(radio==="profesor") return( -

+

@@ -126,7 +123,7 @@ function App() { ) else if(radio==="operador") return( -

+

@@ -134,7 +131,7 @@ function App() { ) else if(radio==="admin") return( -

+

diff --git a/components/profesores_registro/invitado.js b/components/profesores_registro/invitado.js index 7c6583a..5872d38 100644 --- a/components/profesores_registro/invitado.js +++ b/components/profesores_registro/invitado.js @@ -9,9 +9,9 @@ function Invitado(props){ -

Nombre(s):

-

Apellidos:

-

Edad:

+

Nombre(s):

+

Apellidos:

+

Edad:

@@ -31,9 +31,9 @@ function Invitado(props){ -
-
-
+
+
+