Refresh PWA icons and splash assets
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Component, useEffect, useState, type ErrorInfo, type ReactElement, type ReactNode } from "react";
|
||||
import { NavLink, Navigate, Route, Routes, useLocation } from "react-router-dom";
|
||||
import { Navigate, Route, Routes, useLocation, useNavigate } from "react-router-dom";
|
||||
|
||||
import { WalkupProvider, useWalkupContext } from "./hooks/useWalkupContext";
|
||||
import { useSession } from "./hooks/useSession";
|
||||
@@ -228,6 +228,7 @@ function ShellLayout() {
|
||||
const [navOpen, setNavOpen] = useState(false);
|
||||
const walkup = useWalkupContext();
|
||||
const location = useLocation();
|
||||
const navigate = useNavigate();
|
||||
const isOnline = useOnlineStatus();
|
||||
const currentPageLabel = getNavbarPageLabel(location.pathname);
|
||||
const showNavbar = walkup.sessionQuery.data?.authenticated === true;
|
||||
@@ -250,12 +251,17 @@ function ShellLayout() {
|
||||
};
|
||||
}, [showTeamSelectionModal]);
|
||||
|
||||
function goTo(pathname: string) {
|
||||
setNavOpen(false);
|
||||
navigate(pathname);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={shellClassName}>
|
||||
{showNavbar ? (
|
||||
<nav className="navbar navbar-expand-lg navbar-dark bg-dark shadow-sm sticky-top px-3 py-2" aria-label="Primary">
|
||||
<div className="container-fluid">
|
||||
<NavLink to="/" className="navbar-brand d-flex align-items-center gap-3 mb-0">
|
||||
<button type="button" className="navbar-brand d-flex align-items-center gap-3 mb-0 btn btn-link p-0 text-decoration-none" onClick={() => goTo("/")}>
|
||||
<span className="site-brand-mark" aria-hidden="true">
|
||||
<i className="bi bi-person-walking" />
|
||||
</span>
|
||||
@@ -265,7 +271,7 @@ function ShellLayout() {
|
||||
<span className="navbar-text d-lg-none small lh-1 text-white-50">{currentPageLabel}</span>
|
||||
) : null}
|
||||
</span>
|
||||
</NavLink>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="navbar-toggler ms-auto"
|
||||
@@ -279,24 +285,40 @@ function ShellLayout() {
|
||||
<div id="primary-nav" className={`navbar-collapse collapse${navOpen ? " show" : ""}`}>
|
||||
<ul className="navbar-nav ms-auto gap-2">
|
||||
<li className="nav-item">
|
||||
<NavLink to="/" className={({ isActive }) => `nav-link${isActive ? " active" : ""}`}>
|
||||
<button
|
||||
type="button"
|
||||
className={`nav-link btn btn-link${location.pathname === "/" ? " active" : ""}`}
|
||||
onClick={() => goTo("/")}
|
||||
>
|
||||
Home
|
||||
</NavLink>
|
||||
</button>
|
||||
</li>
|
||||
<li className="nav-item">
|
||||
<NavLink to="/library" className={({ isActive }) => `nav-link${isActive ? " active" : ""}`}>
|
||||
<button
|
||||
type="button"
|
||||
className={`nav-link btn btn-link${location.pathname === "/library" ? " active" : ""}`}
|
||||
onClick={() => goTo("/library")}
|
||||
>
|
||||
Walkup Clips
|
||||
</NavLink>
|
||||
</button>
|
||||
</li>
|
||||
<li className="nav-item">
|
||||
<NavLink to="/gameday" className={({ isActive }) => `nav-link${isActive ? " active" : ""}`}>
|
||||
<button
|
||||
type="button"
|
||||
className={`nav-link btn btn-link${location.pathname === "/gameday" ? " active" : ""}`}
|
||||
onClick={() => goTo("/gameday")}
|
||||
>
|
||||
Gameday
|
||||
</NavLink>
|
||||
</button>
|
||||
</li>
|
||||
<li className="nav-item">
|
||||
<NavLink to="/profile" className={({ isActive }) => `nav-link${isActive ? " active" : ""}`}>
|
||||
<button
|
||||
type="button"
|
||||
className={`nav-link btn btn-link${location.pathname === "/profile" ? " active" : ""}`}
|
||||
onClick={() => goTo("/profile")}
|
||||
>
|
||||
Profile
|
||||
</NavLink>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user