|
@@ -52,10 +52,6 @@ export type EditorMode = typeof EditorMode[keyof typeof EditorMode];
|
|
|
* Storing objects to ref
|
|
* Storing objects to ref
|
|
|
*********************************************************** */
|
|
*********************************************************** */
|
|
|
|
|
|
|
|
-export const useSidebarScrollerRef = (initialData?: RefObject<SimpleBar>): SWRResponse<RefObject<SimpleBar>, Error> => {
|
|
|
|
|
- return useStaticSWR<RefObject<SimpleBar>, Error>('sidebarScrollerRef', initialData);
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
export const useCurrentPageTocNode = (): SWRResponse<HtmlElementNode, any> => {
|
|
export const useCurrentPageTocNode = (): SWRResponse<HtmlElementNode, any> => {
|
|
|
const { data: currentPagePath } = useCurrentPagePath();
|
|
const { data: currentPagePath } = useCurrentPagePath();
|
|
|
|
|
|
|
@@ -67,6 +63,10 @@ export const useCurrentPageTocNode = (): SWRResponse<HtmlElementNode, any> => {
|
|
|
* for switching UI
|
|
* for switching UI
|
|
|
*********************************************************** */
|
|
*********************************************************** */
|
|
|
|
|
|
|
|
|
|
+export const useSidebarScrollerRef = (initialData?: RefObject<HTMLDivElement>): SWRResponse<RefObject<HTMLDivElement>, Error> => {
|
|
|
|
|
+ return useSWRStatic<RefObject<HTMLDivElement>, Error>('sidebarScrollerRef', initialData);
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
export const useIsMobile = (): SWRResponse<boolean, Error> => {
|
|
export const useIsMobile = (): SWRResponse<boolean, Error> => {
|
|
|
const key = isClient() ? 'isMobile' : null;
|
|
const key = isClient() ? 'isMobile' : null;
|
|
|
|
|
|