From 6d490df0163816600c84fd4071210b699504d0fa Mon Sep 17 00:00:00 2001 From: Antonio De Lucreziis Date: Fri, 9 Sep 2022 19:01:14 +0200 Subject: [PATCH] Fixed some bugs --- src/components/EventsView.jsx | 13 +++++-------- src/styles/main.scss | 3 ++- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/components/EventsView.jsx b/src/components/EventsView.jsx index 0770a4f..2329eb3 100644 --- a/src/components/EventsView.jsx +++ b/src/components/EventsView.jsx @@ -3,12 +3,13 @@ // import { differenceInMinutes, format, startOfDay } from 'date-fns' -import { it } from 'date-fns/locale' import _ from 'lodash' import { useEffect, useRef, useState } from 'preact/hooks' import { layoutIntervals } from '../interval-layout.js' +const WEEK_DAYS = ['Domenica', 'Lunedì', 'Martedì', 'Mercoledì', 'Giovedì', 'Venerdì', 'Sabato'] + function hashString(str, seed = 0) { let h1 = 0xdeadbeef ^ seed, h2 = 0x41c6ce57 ^ seed @@ -53,12 +54,10 @@ const WorkWeekView = ({ events }) => { ) ) - const weekDays = ['Lunedì', 'Martedì', 'Mercoledì', 'Giovedì', 'Venerdì'] - return (
- {weekDays.map((label, index) => ( + {WEEK_DAYS.slice(1, 6).map((label, index) => (
{label}
@@ -156,8 +155,6 @@ const WorkWeekVerticalView = ({ events, selection, setSelection, hideOtherCourse ) ) - const weekDays = ['Lunedì', 'Martedì', 'Mercoledì', 'Giovedì', 'Venerdì'] - const [currentlyHovered, setCurrentlyHovered] = useState(null) const element = useRef() @@ -227,7 +224,7 @@ const WorkWeekVerticalView = ({ events, selection, setSelection, hideOtherCourse
{Object.values(dayIntervalLayout).map((layout, index) => (
-
{weekDays[index]}
+
{WEEK_DAYS[index + 1]}
{layout.map((events, stackIndex) => ( <> @@ -336,7 +333,7 @@ const CourseView = ({ events, selection, setSelection, hideOtherCourses }) => {
{courseEvents.map(course => (
- {_.capitalize(format(course.start, 'EEEE', { locale: it }))}{' '} + {WEEK_DAYS[course.start.getDay()]}{' '} {format(course.start, 'H:mm')} – {format(course.end, 'H:mm')} {course.aula}
diff --git a/src/styles/main.scss b/src/styles/main.scss index 9d77289..eb1a866 100644 --- a/src/styles/main.scss +++ b/src/styles/main.scss @@ -38,7 +38,7 @@ html { --accent-900: #244624; } -$device-s-width: 420px; +$device-s-width: 500px; // Elements @@ -761,6 +761,7 @@ body { align-self: center; position: relative; + top: 0.5px; left: -0.5rem; width: calc(100% + 1rem);