From cfe3956c980174789cff03ca61635e34424f4e8e Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Sat, 5 Mar 2022 02:38:58 +0100 Subject: [PATCH] feat(ui): filter bar / filter item for calendar trees --- src/App.svelte | 11 +++++++---- src/FilterBar.svelte | 11 +++++++++++ src/FilterItem.svelte | 15 +++++++++++++++ src/calendar.js | 12 ++++++------ 4 files changed, 39 insertions(+), 10 deletions(-) create mode 100644 src/FilterBar.svelte create mode 100644 src/FilterItem.svelte diff --git a/src/App.svelte b/src/App.svelte index 1a553c6..dbfb7dc 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -8,6 +8,7 @@ import frLocale from '@fullcalendar/core/locales/fr'; import Modal, { bind } from 'svelte-simple-modal'; import EventDetails from './EventDetails.svelte'; + import FilterBar from './FilterBar.svelte'; import { refreshEvents, calendarTree } from './calendar'; const modal = writable(null); @@ -39,11 +40,13 @@

Calendrier de la vie étudiante à l'ENS

-
- - +
+ + +
- +
+
diff --git a/src/FilterBar.svelte b/src/FilterBar.svelte new file mode 100644 index 0000000..634a631 --- /dev/null +++ b/src/FilterBar.svelte @@ -0,0 +1,11 @@ + + + diff --git a/src/FilterItem.svelte b/src/FilterItem.svelte new file mode 100644 index 0000000..5fbe2be --- /dev/null +++ b/src/FilterItem.svelte @@ -0,0 +1,15 @@ + + +{#if item != null} +
  • +{item} +
      +{#each Object.entries(children) as [toplevel, subchildren]} + +{/each} +
    +
  • +{/if} diff --git a/src/calendar.js b/src/calendar.js index 3b97c66..7e17974 100644 --- a/src/calendar.js +++ b/src/calendar.js @@ -25,12 +25,12 @@ const calendars = { }; export const calendarTree = { - "Clubs COF": [ - "Club réseau", - "hackENS", - ], - "COF": [], - "Délégation Générale": [], + "Clubs COF": { + "Club réseau": {}, + "hackENS": {}, + }, + "COF": {}, + "Délégation Générale": {}, }; const calendarIds = Object.keys(calendars);