myheats

Live heats, scoring and leaderboard for sport events
git clone https://git.in0rdr.ch/myheats.git
Log | Files | Refs | Pull requests | README | LICENSE

commit a067af77aff2c3ccf9ded1a72fc8e453d65b2424
parent ed5e6b28b382dc2c7d4c37d23235d251e764457f
Author: Andreas Gruhler <andreas.gruhler@adfinis.com>
Date:   Thu, 13 Apr 2023 23:18:08 +0200

feat: simplify navigation

Diffstat:
Msrc/App.js | 17++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/App.js b/src/App.js @@ -18,11 +18,14 @@ function Layout({session}) { <div> <nav> <ul> - <li><Link to="/leaderboard">Leaderboard</Link></li> - <li><Link to="/rate">Rate</Link></li> - <li><Link to="/heats">Heats and Startlists</Link></li> - <li><Link to="/athletes">Athletes</Link></li> - {session ? <li><button onClick={() => supabase.auth.signOut()}>Sign out {session.user.email}</button></li> : ""} + <li><Link to="/">Leaderboard</Link></li> + {session ? <li><Link to="/rate">Rate</Link></li> : ''} + {session ? <li><Link to="/heats">Heats and Startlists</Link></li> : ''} + {session ? <li> <Link to="/athletes">Athletes</Link></li> : ''} + <li> + {session ? <button onClick={() => supabase.auth.signOut()}> Sign out {session.user.email} </button> : + <Link to="/auth">Login</Link>} + </li> </ul> </nav> <Outlet /> @@ -37,7 +40,7 @@ function Layout({session}) { function NoMatch() { return ( <div className="NoMatch"> - Nothing to see here, <Link to="/leaderboard">go to leaderboard</Link> + Nothing to see here, <Link to="/">go to leaderboard</Link> </div> ) } @@ -62,7 +65,7 @@ function App() { <Suspense fallback={<div>Loading...</div>}> <Routes> <Route path="/" element={<Layout session={session} />}> - <Route path="/leaderboard" element={<Leaderboard session={session} />} /> + <Route path="/" element={<Leaderboard session={session} />} /> <Route path="/rate" element={<Rate session={session} />} /> <Route path="/heats" element={<Heats session={session} />} /> <Route path="/athletes" element={<Athletes session={session} />} />