move pages/admin -> pages/admin/cache
add global page title constant
This commit is contained in:
parent
c883e93a53
commit
bf06e9e782
3
apps/web/constants/page.js
Normal file
3
apps/web/constants/page.js
Normal file
@ -0,0 +1,3 @@
|
||||
export const PAGE_TITLE = 'Лизинговый калькулятор - Эволюция';
|
||||
export const PAGE_DESCRIPTION =
|
||||
'Лизинговый калькулятор - Эволюция - Расчет лизинговых платежей - Создание КП';
|
||||
@ -36,6 +36,17 @@ module.exports = withSentryConfig(
|
||||
output: 'standalone',
|
||||
publicRuntimeConfig: publicRuntimeConfigSchema.parse(env),
|
||||
reactStrictMode: true,
|
||||
|
||||
async redirects() {
|
||||
return [
|
||||
{
|
||||
source: '/admin',
|
||||
destination: '/admin/cache',
|
||||
permanent: true,
|
||||
},
|
||||
];
|
||||
},
|
||||
|
||||
async rewrites() {
|
||||
return [
|
||||
{
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
/* eslint-disable @typescript-eslint/explicit-member-accessibility */
|
||||
import { metaFavicon } from '@/config/meta';
|
||||
import { withBasePath } from '@/config/urls';
|
||||
import { PAGE_DESCRIPTION } from '@/constants/page';
|
||||
import Document, { Head, Html, Main, NextScript } from 'next/document';
|
||||
import { ServerStyleSheet } from 'styled-components';
|
||||
import { createCache, doExtraStyle, StyleProvider } from 'ui/tools';
|
||||
@ -43,7 +44,7 @@ export default class MyDocument extends Document {
|
||||
<Head>
|
||||
<meta charSet="utf-8" />
|
||||
<meta name="theme-color" content="#000000" />
|
||||
<meta name="description" content="Лизинговый калькулятор - Эволюция" />
|
||||
<meta name="description" content={PAGE_DESCRIPTION} />
|
||||
{metaFavicon}
|
||||
</Head>
|
||||
<body>
|
||||
|
||||
@ -6,6 +6,7 @@ import { Error } from '@/Components/Common/Error';
|
||||
import { AdminGrid } from '@/Components/Layout/Page';
|
||||
import { unlimitedRoles } from '@/config/users';
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import { getPageTitle } from '@/utils/page';
|
||||
import { dehydrate, QueryClient } from '@tanstack/react-query';
|
||||
import Head from 'next/head';
|
||||
|
||||
@ -13,7 +14,7 @@ function Content() {
|
||||
return (
|
||||
<AdminGrid>
|
||||
<Head>
|
||||
<title>Панель управления</title>
|
||||
<title>{getPageTitle('Управление кэшем')}</title>
|
||||
</Head>
|
||||
<CacheQueries />
|
||||
</AdminGrid>
|
||||
@ -7,6 +7,7 @@ import Output from '@/Components/Output';
|
||||
import { defaultRoles } from '@/config/users';
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import * as hooks from '@/process/hooks';
|
||||
import { getPageTitle } from '@/utils/page';
|
||||
import { dehydrate, QueryClient } from '@tanstack/react-query';
|
||||
import Head from 'next/head';
|
||||
|
||||
@ -19,7 +20,7 @@ function Content() {
|
||||
return (
|
||||
<Grid>
|
||||
<Head>
|
||||
<title>Лизинговый калькулятор - Эволюция</title>
|
||||
<title>{getPageTitle()}</title>
|
||||
</Head>
|
||||
<Calculation.Form prune={['unlimited']} />
|
||||
<Calculation.Settings />
|
||||
|
||||
@ -6,6 +6,7 @@ import Output from '@/Components/Output';
|
||||
import { unlimitedRoles } from '@/config/users';
|
||||
import * as hooks from '@/process/hooks';
|
||||
import { useStore } from '@/stores/hooks';
|
||||
import { getPageTitle } from '@/utils/page';
|
||||
import Head from 'next/head';
|
||||
|
||||
function Content() {
|
||||
@ -21,8 +22,7 @@ function Content() {
|
||||
return (
|
||||
<Grid>
|
||||
<Head>
|
||||
<title>Лизинговый калькулятор без ограничений - Эволюция</title>
|
||||
<meta name="description" content="Лизинговый калькулятор без ограничений - Эволюция" />
|
||||
<title>{getPageTitle('Без ограничений')}</title>
|
||||
</Head>
|
||||
<Calculation.Form />
|
||||
<Calculation.Settings />
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "Лизинговый калькулятор | Эволюция",
|
||||
"short_name": "Лизинговый калькулятор | Эволюция",
|
||||
"name": "Лизинговый калькулятор - Эволюция",
|
||||
"short_name": "Калькулятор",
|
||||
"start_url": "/",
|
||||
"icons": [
|
||||
{
|
||||
|
||||
7
apps/web/utils/page.tsx
Normal file
7
apps/web/utils/page.tsx
Normal file
@ -0,0 +1,7 @@
|
||||
import { PAGE_TITLE } from '@/constants/page';
|
||||
|
||||
export function getPageTitle(title?: string) {
|
||||
if (!title) return PAGE_TITLE;
|
||||
|
||||
return `${title} - ${PAGE_TITLE}`;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user