From 6390c7630d09905dc9ba1a8edc28719b4c0132fe Mon Sep 17 00:00:00 2001 From: "haitao(lj)" Date: Fri, 9 Dec 2022 16:12:09 +0800 Subject: [PATCH] fix(install,maintenance): et the page title correctly --- ui/src/pages/Install/index.tsx | 157 ++++++++++++++++------------- ui/src/pages/Maintenance/index.tsx | 35 +++---- 2 files changed, 103 insertions(+), 89 deletions(-) diff --git a/ui/src/pages/Install/index.tsx b/ui/src/pages/Install/index.tsx index a06b3892..70674def 100644 --- a/ui/src/pages/Install/index.tsx +++ b/ui/src/pages/Install/index.tsx @@ -1,9 +1,8 @@ -/* eslint-disable prettier/prettier */ import { FC, useState, useEffect } from 'react'; import { Container, Row, Col, Card, Alert } from 'react-bootstrap'; import { useTranslation, Trans } from 'react-i18next'; +import { Helmet, HelmetProvider } from 'react-helmet-async'; -import { usePageTags } from '@/hooks'; import type { FormDataType } from '@/common/interface'; import { dbCheck, @@ -224,7 +223,7 @@ const Index: FC = () => { }); if (res && res.config_file_exist) { if (res.db_connection_success) { - setStep(6) + setStep(6); } else { setStep(7); } @@ -239,87 +238,101 @@ const Index: FC = () => { configYmlCheck(); }, []); - usePageTags({ - title: t('install', { keyPrefix: 'page_title' }) - }); if (loading) { return
; } return ( -
- - - -

{t('title')}

- - - {errorData?.msg && ( - {errorData?.msg} - )} + + + {t('install', { keyPrefix: 'page_title' })} + +
+ + + +

{t('title')}

+ + + {errorData?.msg && ( + {errorData?.msg} + )} - + - + - + - + - - {step === 6 && ( -
-
{t('warn_title')}
-

- }} /> - {' '} - - You may try handleInstallNow(e)}>installing now. - -

-
- )} + + {step === 6 && ( +
+
{t('warn_title')}
+

+ }} + />{' '} + + You may try{' '} + handleInstallNow(e)}> + installing now + + . + +

+
+ )} - {step === 7 && ( -
-
{t('db_failed')}
-

- }} /> -

-
- )} + {step === 7 && ( +
+
{t('db_failed')}
+

+ }} + /> +

+
+ )} - {step === 8 && ( -
-
{t('installed')}
-

{t('installed_description')}

-
- )} -
-
- -
-
-
+ {step === 8 && ( +
+
{t('installed')}
+

{t('installed_description')}

+
+ )} +
+
+ +
+
+
+ ); }; diff --git a/ui/src/pages/Maintenance/index.tsx b/ui/src/pages/Maintenance/index.tsx index 25a208a0..905f5ad7 100644 --- a/ui/src/pages/Maintenance/index.tsx +++ b/ui/src/pages/Maintenance/index.tsx @@ -1,28 +1,29 @@ import { Container } from 'react-bootstrap'; +import { Helmet, HelmetProvider } from 'react-helmet-async'; import { useTranslation } from 'react-i18next'; -import { usePageTags } from '@/hooks'; - const Index = () => { const { t } = useTranslation('translation', { keyPrefix: 'page_maintenance', }); - usePageTags({ - title: t('maintenance', { keyPrefix: 'page_title' }), - }); return ( -
- -
- (=‘_‘=) -
-
{t('desc')}
-
-
+ + + {t('maintenance', { keyPrefix: 'page_title' })} + +
+ +
+ (=‘_‘=) +
+
{t('desc')}
+
+
+
); };