diff --git a/i18n/en_US.yaml b/i18n/en_US.yaml index bf3006e1..aeb9b446 100644 --- a/i18n/en_US.yaml +++ b/i18n/en_US.yaml @@ -551,7 +551,7 @@ ui: footer: build_on: >- Built on <1> Answer - the open-source software that power Q&A - communities
Made with love © 2022 Answer + communities.
Made with love © {{cc}}. upload_img: name: Change loading: loading... diff --git a/ui/src/common/constants.ts b/ui/src/common/constants.ts index f0a282ba..ab06f5f9 100644 --- a/ui/src/common/constants.ts +++ b/ui/src/common/constants.ts @@ -1,3 +1,4 @@ +export const DEFAULT_SITE_NAME = 'Answer'; export const DEFAULT_LANG = 'en_US'; export const CURRENT_LANG_STORAGE_KEY = '_a_lang_'; export const LANG_RESOURCE_STORAGE_KEY = '_a_lang_r_'; @@ -9,29 +10,29 @@ export const CAPTCHA_CODE_STORAGE_KEY = '_a_captcha_'; export const ADMIN_LIST_STATUS = { // normal; 1: { - variant: 'success', + variant: 'text-bg-success', name: 'normal', }, // closed; 2: { - variant: 'warning', + variant: 'text-bg-warning', name: 'closed', }, // deleted 10: { - variant: 'danger', + variant: 'text-bg-danger', name: 'deleted', }, normal: { - variant: 'success', + variant: 'text-bg-success', name: 'normal', }, closed: { - variant: 'warning', + variant: 'text-bg-warning', name: 'closed', }, deleted: { - variant: 'danger', + variant: 'text-bg-danger', name: 'deleted', }, }; diff --git a/ui/src/common/interface.ts b/ui/src/common/interface.ts index 60e83af2..c080ce76 100644 --- a/ui/src/common/interface.ts +++ b/ui/src/common/interface.ts @@ -287,9 +287,9 @@ export interface AdminSettingsSmtp { from_name: string; smtp_authentication: boolean; smtp_host: string; - smtp_password: string; + smtp_password?: string; smtp_port: number; - smtp_username: string; + smtp_username?: string; test_email_recipient?: string; } diff --git a/ui/src/components/AccordionNav/index.tsx b/ui/src/components/AccordionNav/index.tsx index cf5620c2..dd0ef6f0 100644 --- a/ui/src/components/AccordionNav/index.tsx +++ b/ui/src/components/AccordionNav/index.tsx @@ -1,5 +1,5 @@ import React, { FC } from 'react'; -import { Accordion, Badge, Button, Stack } from 'react-bootstrap'; +import { Accordion, Button, Stack } from 'react-bootstrap'; import { useTranslation } from 'react-i18next'; import { useNavigate, useMatch } from 'react-router-dom'; @@ -33,9 +33,9 @@ function MenuNode({ menu, callback, activeKey, isLeaf = false }) { {!isLeaf ? : null} {t(menu.name)} {menu.badgeContent ? ( - + {menu.badgeContent} - + ) : null} diff --git a/ui/src/components/Footer/index.tsx b/ui/src/components/Footer/index.tsx index d7664e85..65ac6f33 100644 --- a/ui/src/components/Footer/index.tsx +++ b/ui/src/components/Footer/index.tsx @@ -2,12 +2,20 @@ import React from 'react'; import { Container } from 'react-bootstrap'; 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.getState().siteInfo.name || DEFAULT_SITE_NAME; + const cc = `${fullYear} ${siteName}`; return (