-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathdraft.selectors.ts
More file actions
29 lines (20 loc) · 1.04 KB
/
draft.selectors.ts
File metadata and controls
29 lines (20 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { Categories_Event } from "@core/types/event.types";
import { RootState } from "@web/store";
export const selectDraft = (state: RootState) => state.events.draft.event;
export const selectDraftActivity = (state: RootState) =>
state.events.draft.status?.activity;
export const selectDraftCategory = (state: RootState) =>
state.events.draft.status?.eventType;
export const selectDraftId = (state: RootState) =>
state.events.draft.event?._id;
export const selectDraftStatus = (state: RootState) =>
state.events.draft.status;
export const selectIsDNDing = (state: RootState) =>
state.events.draft.status?.activity === "dnd";
export const selectIsDrafting = (state: RootState) =>
state.events.draft.status?.isDrafting;
export const selectIsDraftingExisting = (state: RootState) =>
state.events.draft.event?._id !== undefined;
export const selectIsDraftingSomeday = (state: RootState) =>
state.events.draft.status?.eventType === Categories_Event.SOMEDAY_WEEK ||
state.events.draft.status?.eventType === Categories_Event.SOMEDAY_MONTH;