Some adjustments

pull/4/head
Antonio De Lucreziis 2 years ago
parent 4a5994210e
commit 22aa06ebf6

@ -10,6 +10,18 @@ You need to have installed `node` and `npm` (or `pnpm`). To setup the project ju
To start the development server run `npm run dev`. To start the development server run `npm run dev`.
#### Prettier Options
```json
"prettier.printWidth": 100,
"prettier.singleQuote": true,
"prettier.quoteProps": "consistent",
"prettier.tabWidth": 4,
"prettier.semi": false,
"prettier.arrowParens": "avoid",
"editor.formatOnSave": true,
```
### Production ### Production
To build the ViteJS project run `npm run build`, for deployment a `.env` files can be used to set the `BASE_URL` variable. To build the ViteJS project run `npm run build`, for deployment a `.env` files can be used to set the `BASE_URL` variable.

@ -3,7 +3,7 @@ import { useEffect, useRef, useState } from 'preact/hooks'
import _ from 'lodash' import _ from 'lodash'
import { differenceInMinutes, startOfDay } from 'date-fns' import { differenceInMinutes, startOfDay } from 'date-fns'
import { hashString, normalizeCourseName, WEEK_DAYS } from '../../utils.jsx' import { normalizeCourseName } from '../../utils.jsx'
import { layoutIntervals } from '../../interval-layout.js' import { layoutIntervals } from '../../interval-layout.js'
export const WorkWeekGrid = ({ events, selection, setSelection, hideOtherCourses }) => { export const WorkWeekGrid = ({ events, selection, setSelection, hideOtherCourses }) => {

@ -3,7 +3,7 @@ import { render } from 'preact'
import { useEffect, useState } from 'preact/hooks' import { useEffect, useState } from 'preact/hooks'
import { ToolOverlay } from './components/CourseVisibility.jsx' import { ToolOverlay } from './components/CourseVisibility.jsx'
import { EventsView, MODE_WORKWEEK_GRID } from './components/EventsView.jsx' import { EventsView, MODE_COURSE, MODE_WORKWEEK_GRID } from './components/EventsView.jsx'
import { HamburgerMenu } from './components/HamburgerMenu.jsx' import { HamburgerMenu } from './components/HamburgerMenu.jsx'
import { Help } from './components/Help.jsx' import { Help } from './components/Help.jsx'
import { Icon } from './components/Icon.jsx' import { Icon } from './components/Icon.jsx'
@ -58,8 +58,6 @@ async function loadEventi(ids) {
}) })
) )
// console.log(calendari)
if (ids.length === 1) { if (ids.length === 1) {
return calendari[0] return calendari[0]
} }
@ -69,11 +67,11 @@ async function loadEventi(ids) {
const App = ({}) => { const App = ({}) => {
// Data Sources // Data Sources
const [source, setSource] = useState('anno-1') const [source, setSource] = useState('magistrale')
const [eventi, setEventi] = useState([]) const [eventi, setEventi] = useState([])
// View Modes // View Modes
const [mode, setMode] = useState(MODE_WORKWEEK_GRID) const [mode, setMode] = useState(MODE_COURSE)
// Selection // Selection
const [selectedCourses, setSelectedCourses] = useState([]) const [selectedCourses, setSelectedCourses] = useState([])
@ -84,7 +82,6 @@ const App = ({}) => {
const [showMobileMenu, setShowMobileMenu] = useState(false) const [showMobileMenu, setShowMobileMenu] = useState(false)
useEffect(async () => { useEffect(async () => {
console.log('source changed')
const eventi = await loadEventi(CALENDAR_IDS[source]) const eventi = await loadEventi(CALENDAR_IDS[source])
window.dataBuffer[source] = eventi window.dataBuffer[source] = eventi
@ -97,7 +94,6 @@ const App = ({}) => {
selectedCourses.length > 0 && selectedCourses.filter(id => groupIds.has(id)).length > 0 selectedCourses.length > 0 && selectedCourses.filter(id => groupIds.has(id)).length > 0
useEffect(() => { useEffect(() => {
console.log('course length changed')
const groupIds = new Set(eventi.map(e => e.nome)) const groupIds = new Set(eventi.map(e => e.nome))
if ( if (

@ -876,15 +876,19 @@ body {
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
height: 100%; height: 100%;
overflow: scroll;
overflow-y: auto;
.grid { .grid {
width: 100%; width: 100%;
max-width: 55rem; max-width: 55rem;
display: grid; display: grid;
grid-template-columns: 3rem repeat(var(--time-length), 1fr); grid-template-columns: 3rem repeat(var(--time-length), 1fr);
grid-template-rows: 2rem repeat(var(--days-length), 1fr); grid-template-rows: 2rem repeat(var(--days-length), 1fr);
border: 2px solid var(--border-500);
border: 1px solid var(--border-600);
border-radius: 10px 10px 0 0; border-radius: 10px 10px 0 0;
@media screen and (max-width: $device-s-width), (pointer: coarse) { @media screen and (max-width: $device-s-width), (pointer: coarse) {
@ -899,6 +903,7 @@ body {
grid-row: 1; grid-row: 1;
grid-column: var(--offset) / span 2; grid-column: var(--offset) / span 2;
} }
.day-name { .day-name {
display: flex; display: flex;
align-items: center; align-items: center;
@ -954,7 +959,7 @@ body {
max-width: 55rem; max-width: 55rem;
display: grid; display: grid;
grid-template-columns: min-content 1fr; grid-template-columns: min-content 1fr;
border: 2px solid var(--border-500); border: 1px solid var(--border-600);
border-radius: 0 0 10px 10px; border-radius: 0 0 10px 10px;
border-top: none; border-top: none;
padding: 1rem; padding: 1rem;

Loading…
Cancel
Save