mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-18 15:23:38 +01:00
feature(components): prop-type NavMenu
This commit is contained in:
parent
de18b03803
commit
86c2b75e61
@ -1,9 +1,10 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
import { useRouter } from 'next/router';
|
import { useRouter } from 'next/router';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import styles from './NavMenu.module.css';
|
import styles from './NavMenu.module.css';
|
||||||
|
|
||||||
export default function NavMenu({ options = [], className, onSelect = () => {} }) {
|
function NavMenu({ options = [], className, onSelect = () => {} }) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -30,3 +31,17 @@ export default function NavMenu({ options = [], className, onSelect = () => {} }
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NavMenu.propTypes = {
|
||||||
|
options: PropTypes.arrayOf(
|
||||||
|
PropTypes.shape({
|
||||||
|
label: PropTypes.node,
|
||||||
|
value: PropTypes.any,
|
||||||
|
className: PropTypes.string,
|
||||||
|
render: PropTypes.func,
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
className: PropTypes.string,
|
||||||
|
onSelect: PropTypes.func,
|
||||||
|
};
|
||||||
|
export default NavMenu;
|
||||||
|
Loading…
Reference in New Issue
Block a user