A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.
feat: add 404 and 50X ui
shuaie7493946385e
diff --git a/ui/src/i18n/locales/en.json b/ui/src/i18n/locales/en.jsonindex e227eb1d..06c32071 100644--- a/ui/src/i18n/locales/en.json+++ b/ui/src/i18n/locales/en.json@@ -718,6 +718,14 @@"x_answers": "answers","x_questions": "questions"},+ "page_404": {+ "description": "Unfortunately, this page doesn't exist.",+ "back_home": "Back to homepage"+ },+ "page_50X": {+ "description": "The server encountered an error and could not complete your request.",+ "back_home": "Back to homepage"+ },"admin": {"admin_header": {"title": "Admin"diff --git a/ui/src/index.scss b/ui/src/index.scssindex f10a766a..92d937c9 100644--- a/ui/src/index.scss+++ b/ui/src/index.scss@@ -60,6 +60,10 @@ a {height: 24px;}+.badge-tag:hover {+ background: #9EC5FE;+}+.divide-line {border-bottom: 1px solid rgba(33, 37, 41, 0.25);}diff --git a/ui/src/pages/404/index.jsx b/ui/src/pages/404/index.jsxindex cca70d8a..df509476 100644--- a/ui/src/pages/404/index.jsx+++ b/ui/src/pages/404/index.jsx@@ -1,3 +1,24 @@-const Index = () => <div>404 page</div>;+import { Container, Button } from 'react-bootstrap';+import { Link } from 'react-router-dom';+import { useTranslation } from 'react-i18next';++const Index = () => {+ const { t } = useTranslation('translation', { keyPrefix: 'page_404' });+ return (+ <Container className="d-flex flex-column justify-content-center align-items-center page-wrap">+ <div+ className="mb-4 text-secondary"+ style={{ fontSize: '120px', lineHeight: 1.2 }}>+ (=‘x‘=)+ </div>+ <div className="text-center mb-4">{t('description')}</div>+ <div className="text-center">+ <Button as={Link} to="/" variant="link">+ {t('back_home')}+ </Button>+ </div>+ </Container>+ );+};export default Index;diff --git a/ui/src/pages/50X/index.jsx b/ui/src/pages/50X/index.jsxindex 57906268..15eeb9e8 100644--- a/ui/src/pages/50X/index.jsx+++ b/ui/src/pages/50X/index.jsx@@ -1,3 +1,24 @@-const Index = () => <div>50X page</div>;+import { Container, Button } from 'react-bootstrap';+import { Link } from 'react-router-dom';+import { useTranslation } from 'react-i18next';++const Index = () => {+ const { t } = useTranslation('translation', { keyPrefix: 'page_50X' });+ return (+ <Container className="d-flex flex-column justify-content-center align-items-center page-wrap">+ <div+ className="mb-4 text-secondary"+ style={{ fontSize: '120px', lineHeight: 1.2 }}>+ (=T^T=)+ </div>+ <div className="text-center mb-3">{t('description')}</div>+ <div className="text-center">+ <Button as={Link} to="/" variant="link">+ {t('back_home')}+ </Button>+ </div>+ </Container>+ );+};export default Index;diff --git a/ui/src/pages/QuestionDetail/components/Alert/index.tsx b/ui/src/pages/QuestionDetail/components/Alert/index.tsxindex 8b957904..4b84c797 100644--- a/ui/src/pages/QuestionDetail/components/Alert/index.tsx+++ b/ui/src/pages/QuestionDetail/components/Alert/index.tsx@@ -1,21 +1,12 @@-import { memo, FC, useState } from 'react';+import { memo, FC } from 'react';import { Alert } from 'react-bootstrap';interface Props {data;}const Index: FC<Props> = ({ data }) => {- const [show, setShow] = useState(Boolean(data.operation_description));-return (- <Alert- className="mb-4"- variant="info"- show={show}- dismissible- onClose={() => {- setShow(false);- }}>+ <Alert className="mb-4" variant="info"><div><strong>{data.operation_msg} </strong>{data.operation_description}