Skip to content

Commit

Permalink
feat: zh and us (#82)
Browse files Browse the repository at this point in the history
* feat: zh and us

* feat: test code
  • Loading branch information
liukaiming-alipay authored Dec 11, 2024
1 parent 6606e37 commit 93ccf81
Show file tree
Hide file tree
Showing 16 changed files with 1,021 additions and 565 deletions.
33 changes: 22 additions & 11 deletions osgraph-web/src/404/index.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
/** @jsxImportSource @emotion/react */
import { useTranslation } from "react-i18next";
import { Button, Result } from 'antd';
import { Button, Result } from "antd";
import { useNavigate } from "react-router-dom";

const PageNotFound: React.FC<{source?: string}> = props => {
const PageNotFound: React.FC<{ source?: string }> = (props) => {
const { t } = useTranslation();
const navigate = useNavigate();
const { source = '404' } = props;
const { source = "404" } = props;
return (
<div style={{height: '100vh', display: 'flex', alignItems: 'center', justifyContent: 'center'}}>
<Result
status="404"
title={t(source === '404' ? '页面未找到' : '参数错误')}
subTitle={t(source === '404' ? 'Page Not Found' : 'Parameter Error')}
extra={<Button type="primary" onClick={() => navigate('/')}>{t('回到主页')}</Button>}
/>
</div>
<div
style={{
height: "100vh",
display: "flex",
alignItems: "center",
justifyContent: "center",
}}
>
<Result
status="404"
title={t(source === "404" ? "页面未找到" : "参数错误")}
subTitle={t(source === "404" ? "Page Not Found" : "Parameter Error")}
extra={
<Button type="primary" onClick={() => navigate("/")}>
{t("goHome")}
</Button>
}
/>
</div>
);
};

Expand Down
Loading

0 comments on commit 93ccf81

Please sign in to comment.