|
@@ -3,6 +3,7 @@ import { GetServerSideProps, GetServerSidePropsContext } from 'next';
|
|
|
import { SSRConfig, UserConfig } from 'next-i18next';
|
|
import { SSRConfig, UserConfig } from 'next-i18next';
|
|
|
|
|
|
|
|
import { CrowiRequest } from '~/interfaces/crowi-request';
|
|
import { CrowiRequest } from '~/interfaces/crowi-request';
|
|
|
|
|
+import { GrowiThemes } from '~/interfaces/theme';
|
|
|
|
|
|
|
|
import * as nextI18NextConfig from '../next-i18next.config';
|
|
import * as nextI18NextConfig from '../next-i18next.config';
|
|
|
|
|
|
|
@@ -12,6 +13,7 @@ export type CommonProps = {
|
|
|
appTitle: string,
|
|
appTitle: string,
|
|
|
siteUrl: string,
|
|
siteUrl: string,
|
|
|
confidential: string,
|
|
confidential: string,
|
|
|
|
|
+ theme: GrowiThemes,
|
|
|
customTitleTemplate: string,
|
|
customTitleTemplate: string,
|
|
|
csrfToken: string,
|
|
csrfToken: string,
|
|
|
growiVersion: string,
|
|
growiVersion: string,
|
|
@@ -23,7 +25,7 @@ export const getServerSideCommonProps: GetServerSideProps<CommonProps> = async(c
|
|
|
const req: CrowiRequest = context.req as CrowiRequest;
|
|
const req: CrowiRequest = context.req as CrowiRequest;
|
|
|
const { crowi } = req;
|
|
const { crowi } = req;
|
|
|
const {
|
|
const {
|
|
|
- appService, customizeService,
|
|
|
|
|
|
|
+ appService, configManager, customizeService,
|
|
|
} = crowi;
|
|
} = crowi;
|
|
|
|
|
|
|
|
const url = new URL(context.resolvedUrl, 'http://example.com');
|
|
const url = new URL(context.resolvedUrl, 'http://example.com');
|
|
@@ -35,6 +37,7 @@ export const getServerSideCommonProps: GetServerSideProps<CommonProps> = async(c
|
|
|
appTitle: appService.getAppTitle(),
|
|
appTitle: appService.getAppTitle(),
|
|
|
siteUrl: appService.getSiteUrl(),
|
|
siteUrl: appService.getSiteUrl(),
|
|
|
confidential: appService.getAppConfidential() || '',
|
|
confidential: appService.getAppConfidential() || '',
|
|
|
|
|
+ theme: configManager.getConfig('crowi', 'customize:theme'),
|
|
|
customTitleTemplate: customizeService.customTitleTemplate,
|
|
customTitleTemplate: customizeService.customTitleTemplate,
|
|
|
csrfToken: req.csrfToken(),
|
|
csrfToken: req.csrfToken(),
|
|
|
growiVersion: crowi.version,
|
|
growiVersion: crowi.version,
|