mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-14 08:50:31 +00:00
Feature: Added agenda view for calendar, calendar improvements (#2216)
* Feature: Added agenda view for calendar, calendar improvements * Fix duplicate event keys * Additional hover on title, not date * Show date once in list * Rename monthly view for consistency * Remove unneeded key props * CSS cleanup, dont slice title to arbitrary 42 chars which can break column layouts * Simplify agenda components * Fix show date once in list --------- Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
parent
792f768a7f
commit
6898faa3de
11 changed files with 219 additions and 68 deletions
|
@ -1,7 +1,6 @@
|
|||
import { createContext, useState, useMemo } from "react";
|
||||
|
||||
export const EventContext = createContext();
|
||||
export const ShowDateContext = createContext();
|
||||
|
||||
export function EventProvider({ initialEvent, children }) {
|
||||
const [events, setEvents] = useState({});
|
||||
|
@ -14,15 +13,3 @@ export function EventProvider({ initialEvent, children }) {
|
|||
|
||||
return <EventContext.Provider value={value}>{children}</EventContext.Provider>;
|
||||
}
|
||||
|
||||
export function ShowDateProvider({ initialDate, children }) {
|
||||
const [showDate, setShowDate] = useState(null);
|
||||
|
||||
if (initialDate) {
|
||||
setShowDate(initialDate);
|
||||
}
|
||||
|
||||
const value = useMemo(() => ({ showDate, setShowDate }), [showDate]);
|
||||
|
||||
return <ShowDateContext.Provider value={value}>{children}</ShowDateContext.Provider>;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue