-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstores.ts
40 lines (34 loc) · 904 Bytes
/
stores.ts
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
30
31
32
33
34
35
36
37
38
39
40
import { atom } from "recoil";
import type FileSystem from "@oddjs/odd/fs/index";
import type { AccountSettings } from "./lib/account-settings";
import { type Notification } from "./lib/notifications";
import { type SESSION } from "./lib/session";
import { loadTheme, type THEME } from "./lib/theme";
export const filesystemStore = atom({
key: "filesystem",
default: null as FileSystem | null,
});
export const notificationStore = atom({
key: "notifications",
default: [] as Notification[],
});
export const sessionStore = atom({
key: "session",
default: {
address: null,
authed: false,
loading: false,
error: false,
} as SESSION,
});
export const themeStore = atom({
key: "theme",
default: loadTheme() as THEME,
});
export const accountSettingsStore = atom({
key: "accountSettings",
default: {
avatar: null,
loading: true,
} as AccountSettings,
});