11import { onMount , createSignal , Show , type JSX } from "solid-js" ;
2- import { Router , Route , A , useLocation } from "@solidjs/router" ;
2+ import { Router , Route , A } from "@solidjs/router" ;
33import { AppProvider , useApp } from "./data/store" ;
44import { ScenariosPage } from "./pages/ScenariosPage" ;
55import { LiveSimPage } from "./pages/LiveSimPage" ;
66import { ResultsPage } from "./pages/ResultsPage" ;
7- import { RunAllPage } from "./pages/RunAllPage " ;
7+ import { RunsPage } from "./pages/RunsPage " ;
88
99const THEME_KEY = "thegreenepoch-theme" ;
1010
@@ -21,10 +21,6 @@ function applyTheme(theme: "light" | "dark") {
2121}
2222
2323function Layout ( props : { children ?: JSX . Element } ) {
24- const location = useLocation ( ) ;
25- const isActive = ( path : string , end ?: boolean ) =>
26- end ? location . pathname === path : location . pathname . startsWith ( path ) ;
27-
2824 const [ theme , setTheme ] = createSignal ( getInitialTheme ( ) ) ;
2925
3026 onMount ( ( ) => {
@@ -55,19 +51,17 @@ function Layout(props: { children?: JSX.Element }) {
5551 < A
5652 href = "/"
5753 end
58- class = { `px-3 py-1.5 rounded-lg no-underline transition-colors ${ isActive ( "/" , true )
59- ? "bg-accent-subtle text-accent font-medium"
60- : "text-fg-subtle hover:text-fg-body hover:bg-white/5"
61- } `}
54+ class = "px-3 py-1.5 rounded-lg no-underline transition-colors"
55+ activeClass = "bg-accent-subtle text-accent font-medium"
56+ inactiveClass = "text-fg-subtle hover:text-fg-body hover:bg-white/5"
6257 >
6358 Scenarios
6459 </ A >
6560 < A
66- href = "/run-all"
67- class = { `px-3 py-1.5 rounded-lg no-underline transition-colors ${ isActive ( "/run-all" )
68- ? "bg-accent-subtle text-accent font-medium"
69- : "text-fg-subtle hover:text-fg-body hover:bg-white/5"
70- } `}
61+ href = "/runs"
62+ class = "px-3 py-1.5 rounded-lg no-underline transition-colors"
63+ activeClass = "bg-accent-subtle text-accent font-medium"
64+ inactiveClass = "text-fg-subtle hover:text-fg-body hover:bg-white/5"
7165 >
7266 Runs
7367 </ A >
@@ -126,7 +120,7 @@ export function App() {
126120 < Route path = "/" component = { ScenariosPage } />
127121 < Route path = "/simulate/:id" component = { LiveSimPage } />
128122 < Route path = "/results/:id" component = { ResultsPage } />
129- < Route path = "/run-all " component = { RunAllPage } />
123+ < Route path = "/runs " component = { RunsPage } />
130124 </ Router >
131125 </ Show >
132126 ) ;
0 commit comments