From b9cbe2120324e86a436dd6d0509af3063cd278bd Mon Sep 17 00:00:00 2001 From: Franco Speziali Date: Wed, 23 Mar 2022 11:37:00 +0100 Subject: [PATCH] Removed separate Config class --- src/Calendar/index.ts | 9 +++------ src/Config/Config.ts | 9 --------- 2 files changed, 3 insertions(+), 15 deletions(-) delete mode 100644 src/Config/Config.ts diff --git a/src/Calendar/index.ts b/src/Calendar/index.ts index 1acb001..cbfd84e 100644 --- a/src/Calendar/index.ts +++ b/src/Calendar/index.ts @@ -1,5 +1,4 @@ import { GroupTypes } from "../types"; -import Config from "../Config/Config"; import Events from "../Events/"; import { DayGrouping, WeekGrouping, MonthGrouping } from "../EventGrouping"; import { @@ -10,19 +9,17 @@ import { export default class Calendar { private readonly jsonContent: object; - public config: Config; + public groupType: GroupTypes; public events: Events; constructor(json) { this.jsonContent = json; - this.config = new Config({ - groupType: json["group"] ? json["group"].charAt(0) : GroupTypes.Day, - }); + this.groupType = json["group"] ? json["group"].charAt(0) : GroupTypes.Day; this.events = new Events(json["events"]); } render(): HTMLDivElement { - switch (this.config.groupType) { + switch (this.groupType) { case GroupTypes.Day: return new DayRenderer( new DayGrouping(this.events.sortedEvents) diff --git a/src/Config/Config.ts b/src/Config/Config.ts deleted file mode 100644 index b5be1bc..0000000 --- a/src/Config/Config.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { GroupTypes } from "../types"; - -export default class Config { - groupType: GroupTypes; - - constructor({ groupType }) { - this.groupType = groupType.toUpperCase(); - } -}