umami/components/common/MobileMenu.js

23 lines
662 B
JavaScript
Raw Normal View History

2022-03-12 01:04:05 +01:00
import classNames from 'classnames';
2022-03-01 03:39:37 +01:00
import Link from './Link';
import Button from './Button';
import XMark from 'assets/xmark.svg';
import styles from './MobileMenu.module.css';
export default function MobileMenu({ items = [], onClose }) {
return (
2022-03-12 01:04:05 +01:00
<div className={classNames(styles.menu, 'container')}>
2022-03-01 03:39:37 +01:00
<div className={styles.header}>
2022-03-12 01:04:05 +01:00
<Button icon={<XMark />} onClick={onClose} />
2022-03-01 03:39:37 +01:00
</div>
<div className={styles.items}>
{items.map(({ label, value }) => (
<Link key={value} href={value} className={styles.item} onClick={onClose}>
{label}
</Link>
))}
</div>
</div>
);
}