@@ -3,6 +3,7 @@ import { useRouter } from "next/router";
3import { useState } from "react";
3import { useState } from "react";
4import classnames from "classnames";
4import classnames from "classnames";
5import path from "path";
5import path from "path";
6+import MenuTray from "../components/MenuTray";
7function ActiveLink({ children, href, className }) {
8function ActiveLink({ children, href, className }) {
8 const router = useRouter();
9 const router = useRouter();
@@ -21,58 +22,10 @@ function ActiveLink({ children, href, className }) {
24−function MenuTray(props) {
25− // Locks document scrolling when menu is open
26− if (typeof document !== "undefined") {
28− document.body.style.overflow = "hidden";
30− document.body.style.overflow = "visible";
34− // Slides the tray in or out from the left
35− const trayClasses = classnames({
36− "tray-menu-open": props.isOpen,
37− "tray-menu-closed": !props.isOpen,
40− // Fades the background overlay in or out
41− const overlayClasses = classnames({
42− "tray-overlay-open": props.isOpen,
43− "tray-overlay-closed": !props.isOpen,
46− // Hides or shows the menu
47− const menuClasses = classnames({
48− "menu-open": props.isOpen,
49− "menu-closed": !props.isOpen,
53− <nav className={`z-10 w-screen h-screen top-0 left-0 fixed ${menuClasses}`}>
55− onClick={() => props.toggleTray(!props.isOpen)}
56− className={`bg-washedWhite w-screen h-screen ${overlayClasses}`}
59− className={`absolute bg-wall h-screen top-0 left-0 flex flex-col p-4 tray-menu-width ${trayClasses}`}
67// This is the header for the index page
25// This is the header for the index page
68export default function Header(props) {
26export default function Header(props) {
69 const [isOpen, toggleTray] = useState(false);
27 const [isOpen, toggleTray] = useState(false);
71− const mobileSearchButtonClasses = classnames({
77 <header className="layout-wide flex justify-between items-center pt-12">
30 <header className="layout-wide flex justify-between items-center pt-12">
78 <Link href="/">
31 <Link href="/">
@@ -91,7 +44,9 @@ export default function Header(props) {
91 <ActiveLink className="mr-5 type-ui" href="/events">
44 <ActiveLink className="mr-5 type-ui" href="/events">
93 </ActiveLink>
46 </ActiveLink>
94− <button className="mr-5 text-green type-ui">Download Port</button>
47+ <button className="mr-5 text-green type-ui button-text">
96 onClick={(e) => {
51 onClick={(e) => {
97 e.stopPropagation();
52 e.stopPropagation();
@@ -121,51 +76,55 @@ export default function Header(props) {
121 </ActiveLink>
76 </ActiveLink>
122 </MenuTray>
77 </MenuTray>
80+ // Mobile menu button and search button
82+ <div className="block md:hidden">
125− onClick={(e) => {
84+ onClick={(e) => {
126− e.stopPropagation();
85+ e.stopPropagation();
127− props.search.toggleSearch(e);
86+ props.search.toggleSearch(e);
129− className={`z-10 fixed px-4 items-center justify-center type-ui rounded-xl h-16 bg-white text-gray left-4 right-4 bottom-4 mobile-search-button-width ${
88+ className={`z-10 fixed px-4 items-center justify-center type-ui rounded-xl h-16 bg-white text-gray left-4 right-4 bottom-4 mobile-search-button-width ${
130− isOpen ? "flex" : "hidden"
89+ isOpen ? "flex" : "hidden"
134− </button>
93+ </button>
137− onClick={() => toggleTray(!isOpen)}
95+ onClick={() => toggleTray(!isOpen)}
138− className="z-10 fixed bottom-4 right-4 w-16 h-16 bg-ultraDeepWall flex items-center justify-center rounded-full"
96+ className="z-10 fixed bottom-4 right-4 w-16 h-16 bg-ultraDeepWall flex items-center justify-center rounded-full"
140− {isOpen ? (
98+ {isOpen ? (
142− width="16"
100+ width="16"
143− height="16"
101+ height="16"
144− viewBox="0 0 16 16"
102+ viewBox="0 0 16 16"
145− fill="none"
103+ fill="none"
146− xmlns="http://www.w3.org/2000/svg"
104+ xmlns="http://www.w3.org/2000/svg"
149− fill-rule="evenodd"
107+ fill-rule="evenodd"
150− clip-rule="evenodd"
108+ clip-rule="evenodd"
151− d="M0.39382 13.7045C-0.131273 14.2296 -0.131274 15.081 0.39382 15.6061C0.918913 16.1312 1.77026 16.1312 2.29535 15.6061L7.99999 9.90142L13.7047 15.6061C14.2297 16.1312 15.0811 16.1312 15.6062 15.6061C16.1313 15.081 16.1313 14.2296 15.6062 13.7046L9.90152 7.99989L15.6061 2.29535C16.1312 1.77026 16.1312 0.918913 15.6061 0.39382C15.081 -0.131273 14.2296 -0.131273 13.7045 0.39382L7.99999 6.09836L2.29548 0.393844C1.77038 -0.131249 0.919038 -0.13125 0.393945 0.393844C-0.131148 0.918937 -0.131148 1.77028 0.393945 2.29537L6.09846 7.99989L0.39382 13.7045Z"
109+ d="M0.39382 13.7045C-0.131273 14.2296 -0.131274 15.081 0.39382 15.6061C0.918913 16.1312 1.77026 16.1312 2.29535 15.6061L7.99999 9.90142L13.7047 15.6061C14.2297 16.1312 15.0811 16.1312 15.6062 15.6061C16.1313 15.081 16.1313 14.2296 15.6062 13.7046L9.90152 7.99989L15.6061 2.29535C16.1312 1.77026 16.1312 0.918913 15.6061 0.39382C15.081 -0.131273 14.2296 -0.131273 13.7045 0.39382L7.99999 6.09836L2.29548 0.393844C1.77038 -0.131249 0.919038 -0.13125 0.393945 0.393844C-0.131148 0.918937 -0.131148 1.77028 0.393945 2.29537L6.09846 7.99989L0.39382 13.7045Z"
152− fill="white"
110+ fill="white"
157− width="16"
115+ width="16"
158− height="16"
116+ height="16"
159− viewBox="0 0 16 17"
117+ viewBox="0 0 16 17"
160− fill="none"
118+ fill="none"
161− xmlns="http://www.w3.org/2000/svg"
119+ xmlns="http://www.w3.org/2000/svg"
163− <rect width="16" height="3" rx="1.5" fill="white" />
121+ <rect width="16" height="3" rx="1.5" fill="white" />
164− <rect y="7" width="16" height="3" rx="1.5" fill="white" />
122+ <rect y="7" width="16" height="3" rx="1.5" fill="white" />
165− <rect y="14" width="16" height="3" rx="1.5" fill="white" />
123+ <rect y="14" width="16" height="3" rx="1.5" fill="white" />
168− </button>
126+ </button>
169 </header>
128 </header>