Commit 56b91b3b authored by Najib Idrissi's avatar Najib Idrissi
Browse files

more doc

parent a6d104d1
......@@ -4,6 +4,8 @@ Rendu des calendriers ADE sous forme html
![Screenshot](ical-ufr.png)
https://licence.math.univ-paris-diderot.fr/informations/edt/
## Principe
### Ressources ADE
......
import React, { ChangeEventHandler, useEffect, useRef } from "react";
import { Link } from "react-router-dom";
import { OurCalendarProps, getBgColor, getFgColor } from ".";
type GroupChooserProps = OurCalendarProps & {
interface GroupChooserProps extends OurCalendarProps {
shown: Map<number, boolean>;
setShown: React.Dispatch<React.SetStateAction<Map<number, boolean>>>;
};
......@@ -12,6 +11,7 @@ const checkboxDivStyle = "p-2 border rounded-md";
/**
* A component that allows the user to choose from several groups.
* @param groups The possible groups to choose from.
* @param selectGroups Not used.
* @param shown Whether the groups are currently shown or not.
* @param setShown Callback that allows setting `shown`.
*/
......
import React from "react";
import { EventApi } from "@fullcalendar/react";
type ModalEventProps = {
interface ModalEventProps {
event: EventApi | null;
closeCallback: () => void;
};
/**
* A modal ("pop-up") event that appears when an event is clicked.
* @param event The event to be shown.
* @param closeCallback A function that will be called when the event is closed.
*/
const ModalEvent: React.FC<ModalEventProps> = ({ event, closeCallback }) => {
if (event === null) {
......@@ -66,5 +66,5 @@ const ModalEvent: React.FC<ModalEventProps> = ({ event, closeCallback }) => {
</>
);
}
}
};
export default ModalEvent;
......@@ -6,9 +6,10 @@ import listPlugin from '@fullcalendar/list';
import dayGridPlugin from '@fullcalendar/daygrid';
import iCalendarPlugin from '@fullcalendar/icalendar';
import frLocale from '@fullcalendar/core/locales/fr';
import { parcoursTitles } from "../Parcours";
import GroupChooser from "./GroupChooser";
import ModalEvent from "./ModalEvent";
import { parcoursTitles } from "../Parcours";
import GroupsIcal from "./GroupsIcal";
/**
......@@ -71,6 +72,10 @@ export function getFgColor(index: number) {
return brightness >= 128 ? "#000000" : "#ffffff";
}
/**
* A list of colors to be used as borders.
* @todo Doesn't work??
*/
const borderPalette = [
"border-red-700",
"border-yellow-700",
......@@ -98,9 +103,6 @@ export interface Group {
year: string;
}
/**
* The type of the props ("parameters") of OurCalendar
*/
export interface OurCalendarProps {
groups: Group[];
selectedGroup?: string;
......@@ -110,7 +112,6 @@ export interface OurCalendarProps {
* Renders a calendar composed of several groups, together with its title.
* @param groups The groups that should be included in the calendar.
* @param selectedGroup A list of pre-selected group, separated by "+" (does not change on user input).
* @returns The JSX element representing the calendar.
*/
const OurCalendar: React.FC<OurCalendarProps> = ({ groups, selectedGroup }) => {
/**
......
import React from "react";
import { NavLink, Route, Switch, useParams } from "react-router-dom";
import calendars from "../calendars.json";
import ParcoursYear from "./ParcoursYear";
......@@ -22,7 +23,7 @@ export const parcoursTitles = new Map([
]);
type YearChooserProps = {
interface YearChooserProps {
parcours: string;
parcoursTitle: string;
years: string[];
......
import React from "react";
import { useParams } from "react-router-dom";
import calendars from "../calendars.json";
import OurCalendar from "./OurCalendar";
import { parcoursTitles } from "./Parcours";
interface ParcoursYearParams {
parcours: string;
year: string;
selectedGroup?: string;
};
/**
* Affiche un calendrier correspondant à une combinaison parcours + année.
* Sur les URL du type /parcours/.../year/....
* En cas d'URL du type /parcours/.../year/.../group/..., on affiche un groupe pré-selectionné par défaut.
*/
const ParcoursYear: React.FC<{}> = () => {
type ParcoursYearParams = {
parcours: string;
year: string;
selectedGroup?: string;
};
const {
parcours,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment