feat: set application title globally
This commit is contained in:
parent
8c5fefc282
commit
7b909ac6a6
1 changed files with 7 additions and 1 deletions
|
|
@ -6,6 +6,8 @@ import TripChecklist from "./pages/TripChecklist";
|
||||||
import TripsPage from "./pages/TripsPage";
|
import TripsPage from "./pages/TripsPage";
|
||||||
import TagsPage from "./pages/TagsPage";
|
import TagsPage from "./pages/TagsPage";
|
||||||
|
|
||||||
|
const APP_TITLE = "da packste dich weg";
|
||||||
|
|
||||||
function NextTripRedirect({ trips }: { trips: any[] }) {
|
function NextTripRedirect({ trips }: { trips: any[] }) {
|
||||||
const [nextTripId, setNextTripId] = React.useState<string | null>(null);
|
const [nextTripId, setNextTripId] = React.useState<string | null>(null);
|
||||||
const [error, setError] = React.useState<string | null>(null);
|
const [error, setError] = React.useState<string | null>(null);
|
||||||
|
|
@ -51,7 +53,7 @@ function Navigation() {
|
||||||
onClick={goToCurrentTrip}
|
onClick={goToCurrentTrip}
|
||||||
title="Zum aktuellen Trip"
|
title="Zum aktuellen Trip"
|
||||||
>
|
>
|
||||||
Packliste
|
{APP_TITLE}
|
||||||
</button>
|
</button>
|
||||||
{navItems.map((item) => {
|
{navItems.map((item) => {
|
||||||
// Trips ist NICHT aktiv, wenn ein einzelner Trip angezeigt wird
|
// Trips ist NICHT aktiv, wenn ein einzelner Trip angezeigt wird
|
||||||
|
|
@ -108,6 +110,10 @@ export default function App() {
|
||||||
loadTrips();
|
loadTrips();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
document.title = APP_TITLE;
|
||||||
|
}, []);
|
||||||
|
|
||||||
async function goToCurrentTrip() {
|
async function goToCurrentTrip() {
|
||||||
try {
|
try {
|
||||||
const id = await getNextTripId();
|
const id = await getNextTripId();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue