feat: 优化 gitee 初始化 (#32163)

* feat: gitee

* feat: test
This commit is contained in:
叶枫 2021-09-15 13:35:09 +08:00 committed by GitHub
parent 7c41c7d958
commit 0d619be27c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,7 +33,6 @@ export default ({
onLangChange,
onDirectionChange,
}: NavigationProps) => {
const [isGitee, setIsGitee] = React.useState(false);
const menuMode = isMobile ? 'inline' : 'horizontal';
const module = pathname.split('/').slice(0, -1).join('/');
@ -70,10 +69,6 @@ export default ({
);
}
React.useEffect(() => {
setIsGitee(document.location.host.indexOf('gitee') !== -1);
}, []);
return (
<Menu
className={classNames('menu-site')}
@ -109,7 +104,7 @@ export default ({
</a>
</Menu.Item>
)}
{isZhCN && !isGitee && (
{isZhCN && typeof window !== 'undefined' && window.location.host.indexOf('gitee') === -1 && (
<Menu.Item key="mirror">
<a href="https://ant-design.gitee.io"></a>
</Menu.Item>