Skip to content

Commit

Permalink
feat: 优化 gitee 初始化 (ant-design#32163)
Browse files Browse the repository at this point in the history
* feat: gitee

* feat: test
  • Loading branch information
crazyair authored Sep 15, 2021
1 parent 7c41c7d commit 0d619be
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions site/theme/template/Layout/Header/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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('/');
Expand Down Expand Up @@ -70,10 +69,6 @@ export default ({
);
}

React.useEffect(() => {
setIsGitee(document.location.host.indexOf('gitee') !== -1);
}, []);

return (
<Menu
className={classNames('menu-site')}
Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit 0d619be

Please sign in to comment.