Posicionamiento de grupos en la tabla

master
Araozu 2022-10-14 12:22:16 -05:00
parent 93db894306
commit 81deec4461
3 changed files with 11 additions and 16 deletions

View File

@ -128,6 +128,13 @@ export const getHorariosMock: GetHorariosFn = async(_) => {
hora_fin: "1640",
dia: "Miercoles",
},
{
id_horario: 6,
id_laboratorio: 1,
hora_inicio: "1400",
hora_fin: "1640",
dia: "Viernes",
},
],
},
],

View File

@ -24,18 +24,6 @@ export function SistemasMovil() {
);
}
/*
{
id_horario: number,
id_laboratorio: number,
abreviado: string,
grupo: string,
offsetVertical: number, // 07:00 -> 0, 07:50 -> 1
nroHoras: number,
offsetHorizontal: number, // 0, 1, 2
fraccion: number, // por cuanto dividir la celda. 1, 2, 3, ...
}
*/
function transformar(input: ListaCursosCompleto): TableInput {
const data: TableInput = {

View File

@ -52,10 +52,10 @@ function Grupo(props: {data: GrupoDia}) {
});
const estilo = () => {
const fraccion = props.data.fraccion;
const offsetHorizontal = props.data.offsetHorizontal + 1;
const offsetHorizontal = props.data.offsetHorizontal;
const offsetVertical = props.data.offsetVertical;
const nroHoras = props.data.nroHoras;
return `left: calc((43vw / ${fraccion}) * ${offsetHorizontal} - 14vw); top: ${offsetVertical * 3}rem;` +
return `left: calc((43vw / ${fraccion}) * ${offsetHorizontal}); top: ${offsetVertical * 3}rem;` +
`height: ${nroHoras * 3}rem; width: calc(100% / ${fraccion})`;
};
return (
@ -112,8 +112,8 @@ export function Table(props: {datos: TableInput}) {
{(hora) => <div className={css(s.celdaHora)}>{hora.substring(0, 5)}</div>}
</For>
</div>
{martes}
{miercoles}
{jueves}
{viernes}
</div>
);
}