fix: npm run site (#23658)

This commit is contained in:
Tom Xu 2020-04-27 15:02:07 +08:00 committed by GitHub
parent 1a428e852a
commit 2325a4438d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,6 +32,7 @@ export default ({
onLangChange,
onDirectionChange,
}: NavigationProps) => {
const [isGitee, setIsGitee] = React.useState(false);
const menuMode = isMobile ? 'inline' : 'horizontal';
const module = pathname.split('/').slice(0, -1).join('/');
@ -68,7 +69,9 @@ export default ({
);
}
const isGitee = document.location.host.indexOf('gitee') !== -1;
React.useEffect(() => {
setIsGitee(document.location.host.indexOf('gitee') !== -1);
}, []);
return (
<Menu