sidebar-configurations.ts 723 B

1234567891011121314151617181920
  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<SidebarConfigurationProps> = async(context: GetServerSidePropsContext) => {
  5. const req: CrowiRequest = context.req as CrowiRequest;
  6. const { crowi } = req;
  7. const { configManager } = crowi;
  8. return {
  9. props: {
  10. sidebarConfig: {
  11. isSidebarCollapsedMode: configManager.getConfig('customize:isSidebarCollapsedMode'),
  12. isSidebarClosedAtDockMode: configManager.getConfig('customize:isSidebarClosedAtDockMode'),
  13. },
  14. },
  15. };
  16. };