@@ -23,12 +23,10 @@ const NavLink = LoggedInDef.fragment(
2323 ( h , tag : "Dashboard" | "Settings" ) => {
2424 const active = tag === h . props . route . _tag
2525 return h . li . children (
26- h . a . attr ( "href" , LoggedInRoute [ tag ] . href ( ) )
26+ h . a
27+ . attr ( "href" , LoggedInRoute [ tag ] . href ( ) )
2728 . attr ( "aria-current" , active ? "page" : undefined )
28- . class (
29- "hover:bg-blue-600 font-medium px-3 py-1 rounded transition" ,
30- active && "bg-blue-700/50"
31- )
29+ . class ( "hover:bg-blue-600 font-medium px-3 py-1 rounded transition" , active && "bg-blue-700/50" )
3230 . children ( tag )
3331 )
3432 }
@@ -41,33 +39,41 @@ export const LoggedIn = LoggedInDef.make({
4139
4240 view : ( h ) => {
4341 const { route, session } = h . props
44- return h . div . class ( "min-h-screen" ) . children (
45- h . nav . class ( "bg-blue-500 text-white p-4" ) . children (
46- h . div . class ( "max-w-4xl mx-auto flex justify-between items-center" )
42+ return h . div
43+ . class ( "min-h-screen" )
44+ . children (
45+ h . nav
46+ . class ( "bg-blue-500 text-white p-4" )
4747 . children (
48- h . ul . class ( "flex gap-6 list-none" ) . children (
49- NavLink ( h , "Dashboard" ) ,
50- NavLink ( h , "Settings" )
51- ) ,
52- h . div . class ( "text-sm" ) . children ( `Signed in as ${ session . email } ` )
53- )
54- ) ,
55- h . main . class ( "py-8" ) . children (
56- LoggedInRoute . match ( route , {
57- Dashboard : ( ) => DashboardPage ( h , session ) ,
58- Settings : ( ) =>
59- SettingsPage ( h , {
60- session,
61- onSignOut : LoggedInMessage . ClickedSignOut ( )
62- } ) ,
63- NotFound : ( route ) =>
64- NotFound ( h , {
65- path : route . params [ "*" ] ,
66- backHref : LoggedInRoute . Dashboard . href ( ) ,
67- backText : "Go to Dashboard"
48+ h . div
49+ . class ( "max-w-4xl mx-auto flex justify-between items-center" )
50+ . children (
51+ h . ul
52+ . class ( "flex gap-6 list-none" )
53+ . children ( NavLink ( h , "Dashboard" ) , NavLink ( h , "Settings" ) ) ,
54+ h . div
55+ . class ( "text-sm" )
56+ . children ( `Signed in as ${ session . email } ` )
57+ )
58+ ) ,
59+ h . main
60+ . class ( "py-8" )
61+ . children (
62+ LoggedInRoute . match ( route , {
63+ Dashboard : ( ) => DashboardPage ( h , session ) ,
64+ Settings : ( ) =>
65+ SettingsPage ( h , {
66+ session,
67+ onSignOut : LoggedInMessage . ClickedSignOut ( )
68+ } ) ,
69+ NotFound : ( route ) =>
70+ NotFound ( h , {
71+ path : route . params [ "*" ] ,
72+ backHref : LoggedInRoute . Dashboard . href ( ) ,
73+ backText : "Go to Dashboard"
74+ } )
6875 } )
69- } )
76+ )
7077 )
71- )
7278 }
7379} )
0 commit comments