From c0cf0e6861eb443633036d53a28ca2b0cedc0a28 Mon Sep 17 00:00:00 2001 From: "haitao(lj)" Date: Mon, 9 Jan 2023 15:21:25 +0800 Subject: [PATCH] fix(siteName): Use dynamic site names on registration and login pages --- i18n/en_US.yaml | 2 +- ui/src/components/Footer/index.tsx | 4 +--- ui/src/components/Header/index.tsx | 3 +-- ui/src/pages/Users/Login/index.tsx | 14 ++++++++++---- ui/src/pages/Users/Register/index.tsx | 7 +++++-- ui/src/stores/siteInfo.ts | 6 +++++- 6 files changed, 23 insertions(+), 13 deletions(-) diff --git a/i18n/en_US.yaml b/i18n/en_US.yaml index 476bc2a2..35d0f40f 100644 --- a/i18n/en_US.yaml +++ b/i18n/en_US.yaml @@ -607,7 +607,7 @@ ui: msg: empty: Cannot be empty. login: - page_title: Welcome to Answer + page_title: Welcome to {{site_name}} info_sign: Don't have an account? <1>Sign up info_login: Already have an account? <1>Log in agreements: By registering, you agree to the <1>privacy policy and <3>terms of service. diff --git a/ui/src/components/Footer/index.tsx b/ui/src/components/Footer/index.tsx index eb31feec..578576ce 100644 --- a/ui/src/components/Footer/index.tsx +++ b/ui/src/components/Footer/index.tsx @@ -5,12 +5,10 @@ import { Trans } from 'react-i18next'; import dayjs from 'dayjs'; import { siteInfoStore } from '@/stores'; -import { DEFAULT_SITE_NAME } from '@/common/constants'; const Index = () => { const fullYear = dayjs().format('YYYY'); - const siteName = - siteInfoStore((state) => state.siteInfo.name) || DEFAULT_SITE_NAME; + const siteName = siteInfoStore((state) => state.siteInfo.name); const cc = `${fullYear} ${siteName}`; return (