Skip to content

Commit

Permalink
fix: Error on Safari in header
Browse files Browse the repository at this point in the history
  • Loading branch information
kriscooke committed Jul 16, 2020
1 parent 6492612 commit cf615af
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions app/components/Layout/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useState, useRef, useEffect} from 'react';
import React, {useState, useRef} from 'react';
import {Form} from 'react-bootstrap';
import Link from 'next/link';
import LoginButton from 'components/LoginButton';
Expand Down Expand Up @@ -30,18 +30,6 @@ const HeaderLayout = ({isLoggedIn = false, isRegistered = false}) => {
});
};

// Listen for media query change (ie: device is rotated or window resized) to reset
// the nav menu toggle and ensure it's not accidentally hidden on desktop
useEffect(() => {
const query = desktopMediaQuery.current;
const listener = query?.addEventListener('change', ({target}: any) => {
setNavMenuHidden(!target.matches);
});
return () => {
query?.removeEventListener('change', listener);
};
});

return (
<header>
<nav>
Expand Down

0 comments on commit cf615af

Please sign in to comment.