|
@@ -15,6 +15,8 @@ const logger = loggerFactory('growi:stores:ui');
|
|
|
|
|
|
|
|
const isServer = typeof window === 'undefined';
|
|
const isServer = typeof window === 'undefined';
|
|
|
|
|
|
|
|
|
|
+type Nullable<T> = T | null;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
/** **********************************************************
|
|
/** **********************************************************
|
|
|
* Unions
|
|
* Unions
|
|
@@ -215,3 +217,15 @@ export const usePageCreateModalOpened = (isOpened?: boolean): SWRResponse<boolea
|
|
|
const initialData = false;
|
|
const initialData = false;
|
|
|
return useStaticSWR('isPageCreateModalOpened', isOpened || null, { fallbackData: initialData });
|
|
return useStaticSWR('isPageCreateModalOpened', isOpened || null, { fallbackData: initialData });
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
|
|
+export const useSelectedGrant = (initialData?: Nullable<number>): SWRResponse<Nullable<number>, Error> => {
|
|
|
|
|
+ return useStaticSWR<Nullable<number>, Error>('grant', initialData ?? null);
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+export const useSelectedGrantGroupId = (initialData?: Nullable<string>): SWRResponse<Nullable<string>, Error> => {
|
|
|
|
|
+ return useStaticSWR<Nullable<string>, Error>('grantGroupId', initialData ?? null);
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+export const useSelectedGrantGroupName = (initialData?: Nullable<string>): SWRResponse<Nullable<string>, Error> => {
|
|
|
|
|
+ return useStaticSWR<Nullable<string>, Error>('grantGroupName', initialData ?? null);
|
|
|
|
|
+};
|