diff --git a/www/components/Hero.tsx b/www/components/Hero.tsx
index b601e736d9b..d0a286c120d 100644
--- a/www/components/Hero.tsx
+++ b/www/components/Hero.tsx
@@ -64,11 +64,6 @@ const Hero = () => {
src="images/logos/mozilla--grey.png"
alt="Mozilla"
/>
-
diff --git a/www/components/Nav/index.tsx b/www/components/Nav/index.tsx
index b4a24d7b680..85adc806c1a 100644
--- a/www/components/Nav/index.tsx
+++ b/www/components/Nav/index.tsx
@@ -17,6 +17,10 @@ const Nav = (props: Props) => {
const { darkMode } = props
const [open, setOpen] = useState(false)
+ const [openProduct, setOpenProduct] = useState(false)
+ const [openDevelopers, setOpenDevelopers] = useState(false)
+ const [openCompany, setOpenCompany] = useState(false)
+
React.useEffect(() => {
if (open) {
console.log('open if')
@@ -25,11 +29,25 @@ const Nav = (props: Props) => {
} else {
document.body.style.overflow = 'auto'
}
+
+ // window is accessible here.
+ window.addEventListener('scroll', function (e) {
+ // close Fly Outs window if user scrolls past 96px from top
+ if (window.pageYOffset > 96) {
+ handleCancel()
+ }
+ })
}, [open])
- function handleNavClick() {
- // @ts-ignore
- ref.current
+ function handleToggle(callback: any) {
+ handleCancel()
+ callback()
+ }
+
+ function handleCancel() {
+ setOpenProduct(false)
+ setOpenDevelopers(false)
+ setOpenCompany(false)
}
const iconSections = Object.values(SolutionsData).map((solution: any, idx: number) => {
@@ -135,6 +153,36 @@ const Nav = (props: Props) => {
)
+ const FlyOutNavButton = (props: any) => (
+