mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-03-15 02:30:25 +01:00
feat: ✨ Permetti di personalizzare il titolo della pagina
This commit is contained in:
parent
d98718cedc
commit
ef15adcb88
@ -45,10 +45,14 @@ export default abstract class Page<A extends PageAttributes = PageAttributes> ex
|
||||
}
|
||||
|
||||
if (this.title) {
|
||||
document.title = `${this.title} - OpenSTAManager`;
|
||||
document.title = this.pageTitle();
|
||||
}
|
||||
}
|
||||
|
||||
pageTitle(): string {
|
||||
return this.title ? `${this.title} - OpenSTAManager` : 'OpenSTAManager';
|
||||
}
|
||||
|
||||
contents(vnode: Vnode<A>): Children | Collection<Children> {
|
||||
return undefined;
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ import '@osm/../scss/app.scss';
|
||||
import {createInertiaApp} from '@maicol07/inertia-mithril';
|
||||
import {showSnackbar} from '@osm/utils/misc';
|
||||
import Mithril from 'mithril';
|
||||
import Stream from 'mithril/stream';
|
||||
import {registerSW} from 'virtual:pwa-register';
|
||||
|
||||
import {resolvePage} from '~inertia';
|
||||
@ -29,8 +30,11 @@ window.__ = stringTranslator;
|
||||
// Load modules bootstrap file
|
||||
import.meta.glob('../../vendor/**/**/resources/{js,ts}/bootstrap.{tsx,ts,js,jsx}', {eager: true});
|
||||
|
||||
// eslint-disable-next-line import/no-mutable-exports,import/prefer-default-export,prefer-const
|
||||
export const titleCallback = Stream((title: string) => `${title} - OpenSTAManager`);
|
||||
|
||||
await createInertiaApp({
|
||||
title: ((title) => `${title} - OpenSTAManager`),
|
||||
title: (title) => titleCallback()(title),
|
||||
// This rule is disabled to avoid a bug in Inertia plugin
|
||||
// eslint-disable-next-line arrow-body-style
|
||||
resolve: resolvePage(() => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user