|
|
@@ -7,10 +7,14 @@ import dynamic from 'next/dynamic';
|
|
|
import Head from 'next/head';
|
|
|
|
|
|
import type { CrowiRequest } from '~/interfaces/crowi-request';
|
|
|
+import type { ISidebarConfig } from '~/interfaces/sidebar-config';
|
|
|
import type { IDataTagCount } from '~/interfaces/tag';
|
|
|
import type { IUserUISettings } from '~/interfaces/user-ui-settings';
|
|
|
import type { UserUISettingsModel } from '~/server/models/user-ui-settings';
|
|
|
import { useSWRxTagsList } from '~/stores/tag';
|
|
|
+import {
|
|
|
+ usePreferDrawerModeByUser, usePreferDrawerModeOnEditByUser, useSidebarCollapsed, useCurrentSidebarContents, useCurrentProductNavWidth,
|
|
|
+} from '~/stores/ui';
|
|
|
|
|
|
import { BasicLayout } from '../components/Layout/BasicLayout';
|
|
|
import {
|
|
|
@@ -30,7 +34,12 @@ type Props = CommonProps & {
|
|
|
isSearchServiceConfigured: boolean,
|
|
|
isSearchServiceReachable: boolean,
|
|
|
isSearchScopeChildrenAsDefault: boolean,
|
|
|
+
|
|
|
+ // ui
|
|
|
userUISettings?: IUserUISettings
|
|
|
+
|
|
|
+ // sidebar
|
|
|
+ sidebarConfig: ISidebarConfig,
|
|
|
};
|
|
|
|
|
|
const TagList = dynamic(() => import('~/components/TagList'), { ssr: false });
|
|
|
@@ -58,6 +67,12 @@ const TagPage: NextPage<CommonProps> = (props: Props) => {
|
|
|
useIsSearchServiceReachable(props.isSearchServiceReachable);
|
|
|
useIsSearchScopeChildrenAsDefault(props.isSearchScopeChildrenAsDefault);
|
|
|
|
|
|
+ usePreferDrawerModeByUser(props.userUISettings?.preferDrawerModeByUser ?? props.sidebarConfig.isSidebarDrawerMode);
|
|
|
+ usePreferDrawerModeOnEditByUser(props.userUISettings?.preferDrawerModeOnEditByUser);
|
|
|
+ useSidebarCollapsed(props.userUISettings?.isSidebarCollapsed ?? props.sidebarConfig.isSidebarClosedAtDockMode);
|
|
|
+ useCurrentSidebarContents(props.userUISettings?.currentSidebarContents);
|
|
|
+ useCurrentProductNavWidth(props.userUISettings?.currentProductNavWidth);
|
|
|
+
|
|
|
return (
|
|
|
<>
|
|
|
<Head>
|
|
|
@@ -117,6 +132,11 @@ function injectServerConfigurations(context: GetServerSidePropsContext, props: P
|
|
|
props.isSearchServiceConfigured = searchService.isConfigured;
|
|
|
props.isSearchServiceReachable = searchService.isReachable;
|
|
|
props.isSearchScopeChildrenAsDefault = configManager.getConfig('crowi', 'customize:isSearchScopeChildrenAsDefault');
|
|
|
+
|
|
|
+ props.sidebarConfig = {
|
|
|
+ isSidebarDrawerMode: configManager.getConfig('crowi', 'customize:isSidebarDrawerMode'),
|
|
|
+ isSidebarClosedAtDockMode: configManager.getConfig('crowi', 'customize:isSidebarClosedAtDockMode'),
|
|
|
+ };
|
|
|
}
|
|
|
|
|
|
export const getServerSideProps: GetServerSideProps = async(context: GetServerSidePropsContext) => {
|