@ -36,7 +36,7 @@
: key = "item.name"
: to = "item.path"
class = "nav-tab"
: class = "{ active: $route.name === item.nam e }"
: class = "{ active: tru e }"
>
< span class = "nav-icon" > { { item . icon } } < / span >
< span class = "nav-label" > { { item . label } } < / span >
@ -46,50 +46,28 @@
< / template >
< script lang = "ts" >
import { Component , Vue } from 'vue-facing-decorator'
import { useAppStore } from '@/stores/app'
import { Vue , Component , toNative } from 'vue-facing-decorator'
interface NavigationItem {
name : string
path : string
label : string
icon : string
}
type NavItem = { name : string ; path : string ; label : string ; icon : string }
@ Component
export default class AppHeader extends Vue {
private appStore = useAppStore ( )
navigationItems : NavigationItem [ ] = [
{ name : 'Home' , path : '/' , label : 'Home' , icon : '🏠' } ,
{ name : 'Schedule' , path : '/schedule' , label : 'Schedule' , icon : '📅' } ,
{ name : 'Notifications' , path : '/notifications' , label : 'Notifications' , icon : '🔔' } ,
{ name : 'Status' , path : '/status' , label : 'Status' , icon : '📊' }
]
get platformName ( ) : string {
const platform = this . appStore . platform
return platform . charAt ( 0 ) . toUpperCase ( ) + platform . slice ( 1 )
}
get platformClass ( ) : string {
return ` platform- ${ this . appStore . platform } `
}
get statusClass ( ) : string {
const status = this . appStore . notificationStatus
if ( ! status ) return 'unknown'
if ( status . canScheduleNow ) return 'ready'
return 'not-ready'
}
get statusText ( ) : string {
const status = this . appStore . notificationStatus
if ( ! status ) return 'Unknown'
if ( status . canScheduleNow ) return 'Ready'
return 'Not Ready'
class AppHeader extends Vue {
get platformName ( ) { return 'Daily Notification Test' }
get platformClass ( ) { return 'platform-generic' }
get statusText ( ) { return 'OK' }
get statusClass ( ) { return 'status-ok' }
get navigationItems ( ) : NavItem [ ] {
return [
{ name : 'Home' , path : '/' , label : 'Home' , icon : '🏠' } ,
{ name : 'Schedule' , path : '/schedule' , label : 'Schedule' , icon : '📅' } ,
{ name : 'Notifications' , path : '/notifications' , label : 'Notifications' , icon : '🔔' } ,
{ name : 'Logs' , path : '/logs' , label : 'Logs' , icon : '📋' } ,
]
}
}
export default toNative ( AppHeader )
< / script >
< style scoped >