lume/packages/utils/src/state.ts

28 lines
559 B
TypeScript
Raw Normal View History

2024-01-04 01:52:45 +00:00
import { atom } from "jotai";
2024-01-15 08:33:05 +00:00
import { atomWithStorage } from "jotai/utils";
2024-01-04 01:52:45 +00:00
2024-01-12 13:32:45 +00:00
// Editor
2024-01-04 01:52:45 +00:00
export const editorAtom = atom(false);
export const editorValueAtom = atom([
{
type: "paragraph",
children: [{ text: "" }],
},
]);
2024-01-08 13:18:07 +00:00
2024-01-12 13:32:45 +00:00
// Onboarding
2024-01-20 02:06:00 +00:00
export const onboardingAtom = atomWithStorage("onboarding", {
open: true,
newUser: false,
});
2024-01-11 14:00:42 +00:00
2024-01-12 13:32:45 +00:00
// Activity
2024-01-11 14:00:42 +00:00
export const activityAtom = atom(false);
export const activityUnreadAtom = atom(0);
2024-01-15 07:06:11 +00:00
// Tutorial
2024-01-15 08:33:05 +00:00
export const tutorialAtom = atomWithStorage("tutorial", true);
2024-01-23 06:07:24 +00:00
// Search
export const searchAtom = atom(false);