Pinafore-Web-Client-Frontend/src/routes/_components/Title.html

29 lines
793 B
HTML

<svelte:head>
<title>{title}</title>
</svelte:head>
<script>
import { store } from '../_store/store'
import { formatIntl } from '../_utils/formatIntl'
export default {
data: () => ({
settingsPage: false
}),
store: () => store,
computed: {
showInstanceName: ({ $isUserLoggedIn, settingsPage, $currentInstance }) => (
!!($isUserLoggedIn && !settingsPage && $currentInstance)
),
title: ({ showInstanceName, $currentInstance, $hasNotifications, $numberOfNotifications, name }) => {
return formatIntl('intl.pageTitle', {
showInstanceName,
instanceName: $currentInstance,
hasNotifications: $hasNotifications,
count: $numberOfNotifications,
name
})
}
}
}
</script>