mirror of
https://github.com/urosran/cally.git
synced 2025-11-26 16:34:54 +00:00
21 lines
994 B
TypeScript
21 lines
994 B
TypeScript
import { atom } from "jotai";
|
|
import * as Device from "expo-device";
|
|
import { CalendarEvent } from "@/components/pages/calendar/interfaces";
|
|
|
|
const getDefaultMode = () => {
|
|
const isTablet = Device.deviceType === Device.DeviceType.TABLET;
|
|
return isTablet ? "week" : "3days";
|
|
};
|
|
|
|
export const editVisibleAtom = atom<boolean>(false);
|
|
export const isAllDayAtom = atom<boolean>(false);
|
|
export const eventForEditAtom = atom<CalendarEvent | undefined>(undefined);
|
|
export const isFamilyViewAtom = atom<boolean>(false);
|
|
export const modeAtom = atom<"week" | "month" | "day" | "3days">(getDefaultMode());
|
|
export const selectedDateAtom = atom<Date>(new Date());
|
|
export const selectedNewEventDateAtom = atom<Date | undefined>(undefined);
|
|
export const settingsPageIndex = atom<number>(0);
|
|
export const userSettingsView = atom<boolean>(true);
|
|
export const toDosPageIndex = atom<number>(0);
|
|
export const refreshTriggerAtom = atom<boolean>(false);
|
|
export const refreshEnabledAtom = atom<boolean>(true); |