forked from tovyblox/tovy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
state.ts
43 lines (39 loc) · 817 Bytes
/
state.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
41
42
43
import { atom, selector } from "recoil";
import Router from "next/router";
import { role } from "@prisma/client";
import axios from "axios";
export type workspaceinfo = {
groupId: number;
groupThumbnail: string;
groupName: string
}
const loginState = atom({
key: "loginState",
default: {
userId: 1,
username: '',
displayname: '',
thumbnail: '',
canMakeWorkspace: false,
workspaces: [] as workspaceinfo[]
},
});
const workspacestate = atom({
key: "workspacestate",
default: {
groupId: 1,
groupThumbnail: '',
groupName: '',
yourPermission: [] as string[],
groupTheme: '',
roles: [] as role[],
yourRole: '',
settings: {
guidesEnabled: false,
sessionsEnabled: false,
noticesEnabled: false,
widgets: [] as string[]
}
}
});
export {loginState, workspacestate};