diff --git a/src/components/nav/Burger.tsx b/src/components/nav/Burger.tsx index 47faaa5..5db6755 100644 --- a/src/components/nav/Burger.tsx +++ b/src/components/nav/Burger.tsx @@ -1,133 +1,132 @@ -import React from "react"; -import styled from "styled-components"; -import { useTheme } from "../../styles"; -import { OutlinedButton } from "../button"; -import { Link } from "../link/index"; - -const StyledBurger = styled.div` - margin: 0 0.7rem; - margin-top: 0.5rem; - height: 1.5rem; - width: 2rem; - display: flex; - justify-content: space-between; - flex-direction: column; - align-items: flex-end; - - .line { - height: 0.35rem; - background-color: white; - border: 1px solid ${props => props.theme.colors.textSecondary}; - border-radius: 0.5rem; - } - .big { - width: 2.2rem; - } - .small { - width: 1.7rem; - } -`; - -const GettingStarted = styled.div` - margin: 0 auto; - width: 80%; -`; - -const Ul = styled.ul` - margin: 0 auto; - text-align: center; - width: 100%; - - li { - margin: 1rem 0; - padding: 0.3rem 0; - font-weight: 600; - } - - li:active { - background-color: ${props => props.theme.colors.purple(0.2)}; - } -`; - -const BurgerModal = styled.div` - position: fixed; - z-index: 1; - left: 0; - top: 5rem; - width: 100%; - height: 20rem; - margin: 0 3%; - border-radius: 0.25rem; - background: white; - box-shadow: 0px 12px 19px rgba(0, 0, 0, 0.1); -`; - -const Burger: React.FC = () => { - const [open, setOpen] = React.useState(false); - const { textSecondary } = useTheme().colors; - - const handleSwitch = () => { - setOpen(!open); - }; - - return ( - <> -
- -
-
-
- -
- {open ? ( - <> - - - - - ) : ( - <> - )} - - ); -}; - -export default Burger; +import React from "react"; +import styled from "styled-components"; +import { useTheme } from "../../styles"; +import { OutlinedButton } from "../button"; +import { Link } from "../link/index"; + +const StyledBurger = styled.div` + position: relative; + margin: 0 0.7rem; + margin-top: 0.5rem; + height: 1.5rem; + width: 2rem; + display: flex; + justify-content: space-between; + flex-direction: column; + align-items: flex-end; + cursor: pointer; + + .line { + height: 0.35rem; + background-color: white; + border: 1px solid ${props => props.theme.colors.textSecondary}; + border-radius: 0.5rem; + } + .big { + width: 2.2rem; + } + .small { + width: 1.7rem; + } +`; + +const GettingStarted = styled.div` + margin: 0 auto; + width: 80%; +`; + +const Ul = styled.ul` + margin: 0 auto; + text-align: center; + width: 100%; + + li { + margin: 1rem 0; + padding: 0.3rem 0; + font-weight: 600; + } + + li:active { + background-color: ${props => props.theme.colors.purple(0.2)}; + } +`; + +const BurgerModal = styled.div` + position: absolute; + z-index: 1; + left: 0; + top: 5rem; + width: 100%; + height: 20rem; + border-radius: 0.25rem; + background: white; + box-shadow: 0px 12px 19px rgba(0, 0, 0, 0.1); +`; + +const Burger: React.FC = () => { + const [open, setOpen] = React.useState(false); + const { textSecondary } = useTheme().colors; + + const handleSwitch = () => { + setOpen(!open); + }; + + return ( + <> +
+ +
+
+
+ + {open && ( + <> + + + + + )} +
+ + ); +}; + +export default Burger;