-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Responsive footer links for mobile view
- Loading branch information
1 parent
82237e5
commit 8021a8d
Showing
1 changed file
with
31 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,47 @@ | ||
import React, { useState } from "react"; | ||
import React, { useState, useEffect } from "react"; | ||
import { Box, Nav, Text } from "grommet"; | ||
import { NavLink } from "../atoms/UliCore"; | ||
import { navigate } from "gatsby"; | ||
|
||
export default function Footer() { | ||
|
||
const [windowWidth, setWindowWidth] = useState(window.innerWidth); | ||
|
||
useEffect(() => { | ||
const handleResize = () => { | ||
setWindowWidth(window.innerWidth); | ||
}; | ||
window.addEventListener("resize", handleResize); | ||
return () => window.removeEventListener("resize", handleResize); | ||
}, []); | ||
|
||
const isSmallScreen = windowWidth <= 768; | ||
|
||
|
||
return ( | ||
<Box align="center"> | ||
<Box | ||
margin={{ top: "small", bottom: "small" }} | ||
width={"large"} | ||
direction={"row-responsive"} | ||
gap="small" | ||
style={ | ||
isSmallScreen | ||
? { | ||
flexDirection: "column", | ||
justifyContent: "flex-start", | ||
alignItems: "center", | ||
} | ||
: {} | ||
} | ||
> | ||
<NavLink to="https://twitter.com/tattlemade">Twitter</NavLink> | ||
<NavLink to="/privacy-policy">Privacy Policy</NavLink> | ||
<NavLink to="/blog">Blog</NavLink> | ||
<NavLink to="https://github.com/tattle-made/OGBV/tree/main/uli-website"> | ||
GitHub | ||
</NavLink> | ||
</Box> | ||
<NavLink to="https://twitter.com/tattlemade">Twitter</NavLink> | ||
<NavLink to="/privacy-policy">Privacy Policy</NavLink> | ||
<NavLink to="/blog">Blog</NavLink> | ||
<NavLink to="https://github.com/tattle-made/OGBV/tree/main/uli-website"> | ||
GitHub | ||
</NavLink> | ||
</Box> | ||
</Box > | ||
); | ||
} |