🚨 Fix nestjs warnings, remove old eslint plugins
This commit is contained in:
@@ -9,8 +9,9 @@ import {
|
||||
} from '@mantine/core';
|
||||
import React from 'react';
|
||||
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
|
||||
import { GetServerSidePropsContext } from 'next';
|
||||
import Link from 'next/link';
|
||||
import { getServerSideTranslations } from '../tools/server/getServerSideTranslations';
|
||||
|
||||
const useStyles = createStyles((theme) => ({
|
||||
root: {
|
||||
@@ -94,12 +95,11 @@ export default function Custom404() {
|
||||
</Container>
|
||||
);
|
||||
}
|
||||
|
||||
export async function getStaticProps({ locale }: { locale: string }) {
|
||||
export async function getStaticProps({ req, res, locale }: GetServerSidePropsContext) {
|
||||
const translations = await getServerSideTranslations(['common'], locale, undefined, undefined);
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ['common'])),
|
||||
// Will be passed to the page component as props
|
||||
...translations,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ export async function getServerSideProps({
|
||||
const configPath = path.join(process.cwd(), 'data/configs', `${configName}.json`);
|
||||
const configExists = fs.existsSync(configPath);
|
||||
|
||||
const translations = await getServerSideTranslations(req, res, dashboardNamespaces, locale);
|
||||
const translations = await getServerSideTranslations(dashboardNamespaces, locale, req, res);
|
||||
|
||||
if (!configExists) {
|
||||
// Redirect to 404
|
||||
|
||||
@@ -46,7 +46,7 @@ export async function getServerSideProps({
|
||||
configName = 'default';
|
||||
}
|
||||
|
||||
const translations = await getServerSideTranslations(req, res, dashboardNamespaces, locale);
|
||||
const translations = await getServerSideTranslations(dashboardNamespaces, locale, req, res);
|
||||
const config = getFrontendConfig(configName as string);
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user