@@ -6,6 +6,7 @@ import {Router} from "../router.js"
66import styleCss from "./style.css.js"
77import { Context } from "../context.js"
88import themeCss from "../theme.css.js"
9+ import { Taglines } from "./utils/taglines.js"
910import menu2Svg from "../icons/tabler/menu-2.svg.js"
1011import { DashboardView } from "../pages/dashboard/view.js"
1112
@@ -15,19 +16,27 @@ export class OliveApp extends (view.component(use => {
1516 const context = use . once ( ( ) => new Context ( ) )
1617 const router = use . once ( ( ) => new Router (
1718 [ / ^ $ / , ( ) => DashboardView . props ( context ) . children ( html `< slot > </ slot > ` ) . render ( ) ] ,
18- [ / ^ # \/ a \/ $ / , ( ) => html `account` ] ,
19- [ / ^ # \/ o \/ $ / , ( ) => html `orglist` ] ,
20- [ / ^ # \/ o \/ ( \w + ) $ / , orgId => html `org ${ orgId } ` ] ,
21- [ / ^ # \/ c \/ $ / , ( ) => html `chatlist` ] ,
22- [ / ^ # \/ c \/ ( \w + ) $ / , chatId => html `chat ${ chatId } ` ] ,
19+ [ / ^ # \/ a c c o u n t $ / , ( ) => html `account` ] ,
20+ [ / ^ # \/ o r g s $ / , ( ) => html `orglist` ] ,
21+ [ / ^ # \/ o r g \/ ( \w + ) $ / , orgId => html `org ${ orgId } ` ] ,
22+ [ / ^ # \/ c h a t s $ / , ( ) => html `chatlist` ] ,
23+ [ / ^ # \/ c h a t \/ ( \w + ) $ / , chatId => html `chat ${ chatId } ` ] ,
2324 [ / .* / , ( ) => html `404 not found` ] ,
2425 ) )
2526
2627 const { hash} = router
2728 const $navOpen = use . signal ( false )
29+ const taglines = use . once ( ( ) => new Taglines ( ) )
2830
29- const toggleNav = ( ) => $navOpen ( ! $navOpen ( ) )
30- const closeNav = ( ) => $navOpen ( false )
31+ const toggleNav = async ( force ?: boolean ) => {
32+ const value = force === undefined
33+ ? ! $navOpen ( )
34+ : force
35+ if ( value ) await taglines . nextTagline ( )
36+ await $navOpen ( value )
37+ }
38+
39+ const closeNav = ( ) => toggleNav ( false )
3140
3241 const renderLink = ( label : string , url : string , isActive : boolean ) => html `
3342 < a
@@ -40,20 +49,23 @@ export class OliveApp extends (view.component(use => {
4049
4150 return html `
4251 < nav ?data-open ="${ $navOpen ( ) } ">
43- < button theme =icon @click ="${ toggleNav } "> ${ menu2Svg } </ button >
52+ < button theme =icon @click ="${ ( ) => toggleNav ( ) } "> ${ menu2Svg } </ button >
4453 < div class =navplate ?inert ="${ ! $navOpen ( ) } ">
4554 < header >
4655 < img alt ="" src ="/assets/olive.png "/>
4756 < div >
48- < h1 > Olive Support < small > v${ context . version } </ small > </ h1 >
49- < p > Simple secure customer support.</ p >
57+ < h1 >
58+ < strong > Olive Support</ strong >
59+ < small > v${ context . version } </ small >
60+ </ h1 >
61+ < p > ${ taglines . $tagline ( ) } </ p >
5062 </ div >
5163 </ header >
5264 < div class =links >
53- ${ renderLink ( "Dashboard" , "#/" , hash === "" ) }
54- ${ renderLink ( "Account" , "#/a/ " , hash . startsWith ( "#/a/ " ) ) }
55- ${ renderLink ( "Orgs" , "#/o/ " , hash . startsWith ( "#/a/ " ) ) }
56- ${ renderLink ( "Chats" , "#/c/ " , hash . startsWith ( "#/c/ " ) ) }
65+ ${ renderLink ( "🫒 Dashboard" , "#/" , hash === "" ) }
66+ ${ renderLink ( "👤 Account" , "#/account " , hash . startsWith ( "#/account " ) ) }
67+ ${ renderLink ( "🏛 Orgs" , "#/orgs " , hash . startsWith ( "#/orgs " ) ) }
68+ ${ renderLink ( "💬 Chats" , "#/chats " , hash . startsWith ( "#/chats " ) ) }
5769 </ div >
5870 </ div >
5971 </ nav >
0 commit comments