diff --git a/components/navi.js b/components/navi.js
index f81bfa9..fb0f68a 100644
--- a/components/navi.js
+++ b/components/navi.js
@@ -3,7 +3,7 @@ import Link from 'next/link';
import { useRouter } from 'next/router';
import classNames from 'classnames';
import { Button, Icon } from './jambonz-ui';
-// import { mobileMedia } from '../lib/vars';
+import { homeObj, mobileMedia } from '../lib/vars';
function NaviItem({obj}) {
const router = useRouter();
@@ -30,10 +30,6 @@ function NaviMobile({ active, handler, siteData }) {
'navi__mobile': true,
'active': active,
};
- const homeObj = {
- link: '/',
- label: 'Home',
- };
return (
@@ -65,14 +61,12 @@ function NaviMobile({ active, handler, siteData }) {
export default function Navi({ siteData }) {
const [active, setActive] = useState(false);
+ const [mobile, setMobile] = useState(false);
const handleNavi = () => {
setActive(!active);
};
- /* Example of matchMedia for responsive component...
- const [mobile, setMobile] = useState(false);
-
const handleMedia = (e) => {
setMobile(e.matches);
@@ -93,7 +87,6 @@ export default function Navi({ siteData }) {
mql.removeListener(handleMedia);
}
}, [handleMedia, setMobile]);
- */
return (
-
+ {mobile && }
);
}
\ No newline at end of file
diff --git a/lib/vars.js b/lib/vars.js
index 68ab1b6..9cdf269 100644
--- a/lib/vars.js
+++ b/lib/vars.js
@@ -1,5 +1,11 @@
const mobileMedia = '(max-width: 768px)';
+const homeObj = {
+ link: '/',
+ label: 'Home',
+};
+
export {
+ homeObj,
mobileMedia,
}
\ No newline at end of file