Skip to content

Commit fa77726

Browse files
committed
change event color to grey for recurring events
1 parent b2b9604 commit fa77726

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

client/uis/calendar.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ export class CalendarUI {
4444
return text;
4545
}
4646

47+
private _greyEvents: string[] = ["bocal q&a", "bocal stand-up", "open hour", "open hour with the student council"];
48+
private _isGreyEvent(event: Event42): boolean {
49+
// If the name (even only partially) includes any of this._greyEvents, return true
50+
return this._greyEvents.some(greyEvent => event.name.toLowerCase().includes(greyEvent));
51+
}
52+
4753
/**
4854
* This function checks if there is still enough space on the screen to fit one more event.
4955
*/
@@ -116,7 +122,7 @@ export class CalendarUI {
116122
// Main element
117123
const calendarEvent = document.createElement('div');
118124
calendarEvent.classList.add('calendar-event');
119-
calendarEvent.setAttribute("data-event-kind", (event.name.toLowerCase().includes("bocal q&a") ? "standup" : event.kind));
125+
calendarEvent.setAttribute("data-event-kind", (this._isGreyEvent(event) ? "recurring" : event.kind));
120126
calendarEvent.setAttribute("data-event-id", event.id.toString());
121127
calendarEvent.setAttribute("data-event-timestamp", beginDate.getTime().toString());
122128

static/css/dark.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
--event-color-default: #00BABC;
3232
--event-color-exam: #ED8179;
3333
--event-color-association: #7E93D4;
34-
--event-color-standup: #8E9C9C; /* Bocal Q&A */
34+
--event-color-recurring: #8E9C9C;
3535
--event-color-workshop: #39D88F;
3636
--event-color-rush: #F2911A;
3737
--event-color: var(--event-color-default); /* fallback */

static/css/light.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
--event-color-default: #00BABC;
3232
--event-color-exam: #ED8179;
3333
--event-color-association: #7E93D4;
34-
--event-color-standup: #8E9C9C; /* Bocal Q&A */
34+
--event-color-recurring: #8E9C9C;
3535
--event-color-workshop: #39D88F;
3636
--event-color-rush: #F2911A;
3737
--event-color: var(--event-color-default); /* fallback */

static/css/styles.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,8 +517,8 @@ aside {
517517
--event-color: var(--event-color-workshop);
518518
}
519519

520-
[data-event-kind="standup"] {
521-
--event-color: var(--event-color-standup);
520+
[data-event-kind="recurring"] {
521+
--event-color: var(--event-color-recurring);
522522
}
523523

524524
/* ***************************************** */

0 commit comments

Comments
 (0)