Improve menu icon

This commit is contained in:
rui hildt 2020-05-13 19:16:49 +02:00
parent f6611daad8
commit 06dc0c455e

View File

@ -1,32 +1,22 @@
import React from 'react';
import { useHistory } from 'react-router-dom';
import { Nav, Icon, Dropdown, IconButton, Popover, Whisper } from 'rsuite';
import { Nav, Icon, Dropdown, Popover, Whisper } from 'rsuite';
export default function MenuDropdown() {
const history = useHistory();
const triggerRef = React.createRef();
function handleSelectMenu(eventKey, event) {
console.log(eventKey);
history.push(eventKey);
triggerRef.current.hide();
}
const MenuPopover = ({ onSelect, ...rest }) => (
<Popover {...rest} full>
<Dropdown.Menu onSelect={onSelect}>
<Dropdown.Item
eventKey={0}
onClick={() => history.push('/login')}
>
Login
</Dropdown.Item>
<Dropdown.Item
eventKey={1}
onClick={() => history.push('/register')}
>
Register
</Dropdown.Item>
<Dropdown.Item eventKey={'login'}>Login</Dropdown.Item>
<Dropdown.Item eventKey={'register'}>Register</Dropdown.Item>
<Dropdown.Item eventKey={2}>Dashboard</Dropdown.Item>
<Dropdown.Item eventKey={3}>Schedule a Meeting</Dropdown.Item>
<Dropdown.Item eventKey={4}>Account Settings</Dropdown.Item>
@ -44,11 +34,7 @@ export default function MenuDropdown() {
triggerRef={triggerRef}
speaker={<MenuPopover onSelect={handleSelectMenu} />}
>
<IconButton
appearance='primary'
icon={<Icon size='4x' icon='user-circle' />}
circle
/>
<Icon appearance='primary' size='2x' icon='user-circle' />
</Whisper>
</Nav.Item>
</Nav>