sidebar-configurations.ts 650 B

1234567891011121314151617181920212223
  1. import type { GetServerSideProps, GetServerSidePropsContext } from 'next';
  2. import type { CrowiRequest } from '~/interfaces/crowi-request';
  3. import type { SidebarConfigurationProps } from '../types';
  4. export const getServerSideSidebarConfigProps: GetServerSideProps<
  5. SidebarConfigurationProps
  6. > = async (context: GetServerSidePropsContext) => {
  7. const req: CrowiRequest = context.req as CrowiRequest;
  8. const { crowi } = req;
  9. const { configManager } = crowi;
  10. return {
  11. props: {
  12. sidebarConfig: {
  13. isSidebarCollapsedMode: configManager.getConfig(
  14. 'customize:isSidebarCollapsedMode',
  15. ),
  16. },
  17. },
  18. };
  19. };