Migrate to a monorepo structure (#2909)
This commit is contained in:
@ -0,0 +1,13 @@
|
||||
import { atom } from 'recoil';
|
||||
|
||||
import { User } from '~/generated/graphql';
|
||||
|
||||
export type CurrentUser = Pick<
|
||||
User,
|
||||
'id' | 'email' | 'supportUserHash' | 'canImpersonate'
|
||||
>;
|
||||
|
||||
export const currentUserState = atom<CurrentUser | null>({
|
||||
key: 'currentUserState',
|
||||
default: null,
|
||||
});
|
||||
@ -0,0 +1,8 @@
|
||||
import { atom } from 'recoil';
|
||||
|
||||
import { WorkspaceMember } from '@/workspace-member/types/WorkspaceMember';
|
||||
|
||||
export const currentWorkspaceMemberState = atom<WorkspaceMember | null>({
|
||||
key: 'currentWorkspaceMemberState',
|
||||
default: null,
|
||||
});
|
||||
@ -0,0 +1,18 @@
|
||||
import { atom } from 'recoil';
|
||||
|
||||
import { Workspace } from '~/generated/graphql';
|
||||
|
||||
export type CurrentWorkspace = Pick<
|
||||
Workspace,
|
||||
| 'id'
|
||||
| 'inviteHash'
|
||||
| 'logo'
|
||||
| 'displayName'
|
||||
| 'allowImpersonation'
|
||||
| 'featureFlags'
|
||||
>;
|
||||
|
||||
export const currentWorkspaceState = atom<CurrentWorkspace | null>({
|
||||
key: 'currentWorkspaceState',
|
||||
default: null,
|
||||
});
|
||||
@ -0,0 +1,6 @@
|
||||
import { atom } from 'recoil';
|
||||
|
||||
export const isVerifyPendingState = atom<boolean>({
|
||||
key: 'isVerifyPendingState',
|
||||
default: false,
|
||||
});
|
||||
@ -0,0 +1,10 @@
|
||||
import { atom } from 'recoil';
|
||||
|
||||
import { AuthTokenPair } from '~/generated/graphql';
|
||||
import { cookieStorageEffect } from '~/utils/recoil-effects';
|
||||
|
||||
export const tokenPairState = atom<AuthTokenPair | null>({
|
||||
key: 'tokenPairState',
|
||||
default: null,
|
||||
effects: [cookieStorageEffect('tokenPair')],
|
||||
});
|
||||
Reference in New Issue
Block a user