|
@@ -1,19 +1,68 @@
|
|
|
-import {
|
|
|
|
|
- Typography, Button
|
|
|
|
|
-} from '@mui/material';
|
|
|
|
|
|
|
+import { useState, useEffect, useRef } from 'react';
|
|
|
|
|
+import { Typography, Button, Box, Paper, Divider } from '@mui/material';
|
|
|
|
|
+
|
|
|
|
|
+import useAuth from '../Auth/useAuth.js'
|
|
|
|
|
+import { Service } from '../Utils/HTTP.js';
|
|
|
|
|
+
|
|
|
|
|
+import { TestCard } from '../Components/HomeUser/TestCard';
|
|
|
|
|
|
|
|
export function HomeUser(){
|
|
export function HomeUser(){
|
|
|
- return (
|
|
|
|
|
- <div>
|
|
|
|
|
- <Typography paragraph>
|
|
|
|
|
- Bienvenido User
|
|
|
|
|
- </Typography>
|
|
|
|
|
- <div>
|
|
|
|
|
- <Button onClick={() => console.log("close")}
|
|
|
|
|
- variant="contained">
|
|
|
|
|
- Cerrar Session
|
|
|
|
|
- </Button>
|
|
|
|
|
|
|
+
|
|
|
|
|
+ const auth = useAuth();
|
|
|
|
|
+ const token = useRef(auth.getToken());
|
|
|
|
|
+ const [tests, setTests] = useState([]);
|
|
|
|
|
+
|
|
|
|
|
+ useEffect(() => {
|
|
|
|
|
+
|
|
|
|
|
+ let { email , password} = auth.getProfile();
|
|
|
|
|
+ let rest = new Service(`/plaza/contrasenia/${password}/${email}`);
|
|
|
|
|
+ rest
|
|
|
|
|
+ .get(token.current)
|
|
|
|
|
+ .then(({ data }) => {
|
|
|
|
|
+ console.log("data >>> ", data)
|
|
|
|
|
+ setTests(data.tests)
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(erro => {
|
|
|
|
|
+ console.error("ERR : ", erro)
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ },[auth])
|
|
|
|
|
+
|
|
|
|
|
+ return(
|
|
|
|
|
+ <div className="content-section">
|
|
|
|
|
+ <div className="main">
|
|
|
|
|
+ <Box sx={{ width: '100%' }}>
|
|
|
|
|
+ <Paper elevation={0} sx={{ mb: 2, padding: 2, height: '100%', minHeight: '95vh', boxShadow: 'none !important' }}>
|
|
|
|
|
+ <h2>
|
|
|
|
|
+ Bienvenido al sistemas de pruebas psicometricas.
|
|
|
|
|
+ </h2>
|
|
|
|
|
+ <h3>Instrucciones Generales</h3>
|
|
|
|
|
+ <Typography>
|
|
|
|
|
+ Bienvenido, el sistema tiene como objetivo evaluar diferentes caracteristicas como medir y cuantificar los procesos cognoscitivos de la mente humana.
|
|
|
|
|
+
|
|
|
|
|
+ Parar resolver las pruebas que estan asignadas te recomendamos busques un lugar apropiado ya que necesitaras en promedio 2 horas libre y es importante que se tenga el 100% de tu concentracion.
|
|
|
|
|
+
|
|
|
|
|
+ </Typography>
|
|
|
|
|
+
|
|
|
|
|
+ <Divider style={{margin : 5}}/>
|
|
|
|
|
+
|
|
|
|
|
+ <div className="test_list" style={{ marginTop :15 }}>
|
|
|
|
|
+ {
|
|
|
|
|
+ tests.map( test => {
|
|
|
|
|
+ return (
|
|
|
|
|
+ <TestCard key={test.id} test={test} />
|
|
|
|
|
+ )
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ </Paper>
|
|
|
|
|
+ <Button onClick={auth.logout}>Salir</Button>
|
|
|
|
|
+ </Box>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
)
|
|
)
|
|
|
|
|
+
|
|
|
}
|
|
}
|