Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
console.error(e); // eslint-disable-line no-console
setError(e);
return;
}
setError(null);
}}
editorDidMount={instance => {
cmInstance.current = instance;
}}
/>
);
const fileExtension =
relativePath.split('.')[relativePath.split('.').length - 1] || 'js';
const isWide = useMedia('(min-width: 767.99px)', true);
return (
<div>
<div>
{error ? (
</div></div>
}
}, [path]);
// 移动端下弹出菜单时,禁止页面滚动
useEffect(() => {
if (popupMenuVisible) {
document.documentElement.style.overflow = 'hidden';
} else {
document.documentElement.style.overflow = '';
}
return () => {
document.documentElement.style.overflow = '';
};
}, [popupMenuVisible]);
const isWide = useMedia('(min-width: 767.99px)', true);
const menuIcon = !isWide ? (
) : null;
const productItemProps = isWide
? {
onMouseEnter: onProductMouseEnter,
onMouseLeave: onProductMouseLeave,
}
: {
onClick: onToggleProductMenuVisible,
};
const Room = ({ rooms, activeRoomId }) => {
const isDesktop = useMedia("(min-width: 720px)");
if (!activeRoomId) return null;
return (
{_.map(rooms, (room, roomId) => (
))}
{isDesktop && }
);
<span>
{doc && doc.title
? capitalize(doc.title[i18n.language])
: menuItemLocaleKey}
</span>
}
>
{renderMenuItems(groupedEdges[slugString])}
);
})}
);
const isWide = useMedia('(min-width: 767.99px)', true);
const [drawOpen, setDrawOpen] = useState(false);
const menuSider = isWide ? (
{menu}
) : (
}
wrapperClassName={styles.menuDrawer}
onChange={open => setDrawOpen(!!open)}
width={280}
const WebMentions = props => {
const layers = useLayers();
const textColor = useTextColor();
const isWide = useMedia("(min-width: 480px)");
return (
<div>
Web Mentions
{props.mentions.edges.map(({ node }) => {
const { content, author } = node;
return (
</div>
const menu = (
<menu style="{{" mode="inline"> setOpenKeys(currentOpenKeys)}
inlineIndent={16}
forceSubMenuRender
>
{renderMenu(menuData)}
</menu>
);
const isWide = useMedia('(min-width: 767.99px)', true);
const [drawOpen, setDrawOpen] = useState(false);
const menuSider = isWide ? (
{menu}
) : (
}
wrapperClassName={styles.menuDrawer}
onChange={open => setDrawOpen(!!open)}
width={280}