mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 06:07:17 +01:00
Typescript conversion.
This commit is contained in:
parent
366ef35d3d
commit
8775d696b8
29 changed files with 74 additions and 57 deletions
|
|
@ -1,22 +0,0 @@
|
|||
import { Button, Icon } from 'react-basics';
|
||||
import { useState } from 'react';
|
||||
import MobileMenu from './MobileMenu';
|
||||
import Icons from 'components/icons';
|
||||
|
||||
export function HamburgerButton({ menuItems }) {
|
||||
const [active, setActive] = useState(false);
|
||||
|
||||
const handleClick = () => setActive(state => !state);
|
||||
const handleClose = () => setActive(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Button variant="quiet" onClick={handleClick}>
|
||||
<Icon>{active ? <Icons.Close /> : <Icons.Menu />}</Icon>
|
||||
</Button>
|
||||
{active && <MobileMenu items={menuItems} onClose={handleClose} />}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default HamburgerButton;
|
||||
Loading…
Add table
Add a link
Reference in a new issue