From c7c705460a6bff8e7d0a9a9a694b219a376b31c4 Mon Sep 17 00:00:00 2001 From: Araozu Date: Fri, 14 Oct 2022 17:29:05 -0500 Subject: [PATCH] Simplificar interfaz de horario de pc --- src/Views/pc/Sistemas.tsx | 4 +- src/Views/pc/Sistemas/ContenedorHorarios.tsx | 57 +------- .../Sistemas/ContenedorHorarios/MiHorario.tsx | 127 +++++------------- 3 files changed, 36 insertions(+), 152 deletions(-) diff --git a/src/Views/pc/Sistemas.tsx b/src/Views/pc/Sistemas.tsx index dee863f..5afca79 100644 --- a/src/Views/pc/Sistemas.tsx +++ b/src/Views/pc/Sistemas.tsx @@ -1,8 +1,5 @@ import { BarraSuperior } from "../../BarraSuperior"; import { ContenedorHorarios } from "./Sistemas/ContenedorHorarios"; -import { Show, createSignal } from "solid-js"; -import { css } from "aphrodite"; -import { estilosGlobales } from "../../Estilos"; import { Creditos } from "../../Creditos"; import { Separador } from "../../Separador"; @@ -11,6 +8,7 @@ export function Sistemas() {
+
diff --git a/src/Views/pc/Sistemas/ContenedorHorarios.tsx b/src/Views/pc/Sistemas/ContenedorHorarios.tsx index 37e839c..e771154 100755 --- a/src/Views/pc/Sistemas/ContenedorHorarios.tsx +++ b/src/Views/pc/Sistemas/ContenedorHorarios.tsx @@ -72,35 +72,6 @@ const { export function ContenedorHorarios() { const [datosCargados, setDatosCargados] = createSignal(false); const [datos, setDatos] = createSignal(null); - const [estadoLayout, setEstadoLayout] = ( - createSignal(localStorage.getItem("estadoLayout") as EstadoLayout || "Normal") - ); - - const e = createMemo(() => { - let templateColumns = ""; - switch (estadoLayout()) { - case "MaxHorarios": { - templateColumns = "0 auto"; - break; - } - case "MaxPersonal": { - templateColumns = "auto 0m"; - break; - } - case "Normal": { - templateColumns = "50% 50%"; - } - } - - localStorage.setItem("estadoLayout", estadoLayout()); - - return StyleSheet.create({ - contenedor: { - display: "grid", - gridTemplateColumns: templateColumns, - }, - }); - }); createEffect(async() => { const datos = await datosPromise; @@ -111,28 +82,10 @@ export function ContenedorHorarios() { }); return ( -
-
- -
-
- - agregarCursoUsuario(JSON.parse(JSON.stringify(c)))} - listaCursosUsuario={cursosUsuario} - setCursosUsuarios={setCursosUsuarios} - /> - -
-
+ ); } diff --git a/src/Views/pc/Sistemas/ContenedorHorarios/MiHorario.tsx b/src/Views/pc/Sistemas/ContenedorHorarios/MiHorario.tsx index 5c4dc94..0227ad2 100755 --- a/src/Views/pc/Sistemas/ContenedorHorarios/MiHorario.tsx +++ b/src/Views/pc/Sistemas/ContenedorHorarios/MiHorario.tsx @@ -11,8 +11,6 @@ import { CursosElem } from "./CursosElem"; import { TablaObserver } from "./TablaObserver"; interface MiHorarioProps { - estadoLayout: EstadoLayout, - setEstadoLayout: (v: EstadoLayout) => EstadoLayout, cursosUsuario: ListaCursosUsuario, fnAgregarCurso: (c: Curso) => void, setCursosUsuarios: SetStoreFunction @@ -42,105 +40,40 @@ export function MiHorario(props: MiHorarioProps) { return obj; }); - const fnMaximizar = () => props.setEstadoLayout("MaxPersonal"); - const fnMinimizar = () => props.setEstadoLayout("Normal"); - const estadoActualLayout = () => props.estadoLayout; - - /* TODO: En barra superior colocar todos los horarios. En barra inferior el horario - actual. - Al hacer click en un horario de la barra superior, llevarlo al inicio de la lista. - */ return (
- - +
+ Mi horario +
-
-
- Mi horario -
-
+
+ +
-
-
- Mi horario -
- | - {/* - {}} - /> - {}} - /> - {}} - /> - {}} - /> - | - */} - -
- -
- -
- - "Mi horario"} - dataAnio={datosMiHorario()} - fnAgregarCurso={props.fnAgregarCurso} - listaCursosUsuario={props.cursosUsuario} - esCursoMiHorario - setCursosUsuarios={props.setCursosUsuarios} - tablaObserver={tablaObserver} - /> -
- - {/* - - */} -
- - + "Mi horario"} + dataAnio={datosMiHorario()} + fnAgregarCurso={props.fnAgregarCurso} + listaCursosUsuario={props.cursosUsuario} + esCursoMiHorario + setCursosUsuarios={props.setCursosUsuarios} + tablaObserver={tablaObserver} + />
); }