From 86c2b75e610a4318229a186bc0ead00653201dd1 Mon Sep 17 00:00:00 2001 From: Alexander Klein Date: Tue, 16 Feb 2021 13:31:03 +0100 Subject: [PATCH] feature(components): prop-type NavMenu --- components/common/NavMenu.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/components/common/NavMenu.js b/components/common/NavMenu.js index 6cbe7559..82d97fff 100644 --- a/components/common/NavMenu.js +++ b/components/common/NavMenu.js @@ -1,9 +1,10 @@ import React from 'react'; +import PropTypes from 'prop-types'; import { useRouter } from 'next/router'; import classNames from 'classnames'; import styles from './NavMenu.module.css'; -export default function NavMenu({ options = [], className, onSelect = () => {} }) { +function NavMenu({ options = [], className, onSelect = () => {} }) { const router = useRouter(); return ( @@ -30,3 +31,17 @@ export default function NavMenu({ options = [], className, onSelect = () => {} } ); } + +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;