Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const User: React.FC = () => {
const [open, setOpen] = React.useState(false);
const currentUser = useGlobalState(m => m.user);
const menuItems = useGlobalState(m => m.components.menuItems);
const itemNames = Object.keys(menuItems).filter(m => menuItems[m].settings.type === 'user');
const container = React.useRef(undefined);
const image = currentUser ? require('../images/male.png') : require('../images/female.png');
const items = itemNames.length > 0 && (
<>
<li>
{itemNames.map(name => {
const Component = menuItems[name].component;
return ;
})}
);
useOnClickOutside(container, () => setOpen(false));
return (
<div open=""></div></li>
export const User: React.FC = () => {
const [open, setOpen] = React.useState(false);
const currentUser = useGlobalState(m => m.user);
const menuItems = useGlobalState(m => m.components.menuItems);
const itemNames = Object.keys(menuItems).filter(m => menuItems[m].settings.type === 'user');
const container = React.useRef(undefined);
const image = currentUser ? require('../images/male.png') : require('../images/female.png');
const items = itemNames.length > 0 && (
<>
<li>
{itemNames.map(name => {
const Component = menuItems[name].component;
return ;
})}
);
useOnClickOutside(container, () => setOpen(false));
return (</li>