Added runtimeConfig and used it for appVersion in the footer
This commit is contained in:
parent
3897072e27
commit
52b255df65
4 changed files with 30 additions and 4 deletions
|
|
@ -14,7 +14,11 @@ import {
|
|||
|
||||
import { Separator } from "~/components/ui/separator";
|
||||
|
||||
import { useRuntimeConfig } from "#app";
|
||||
|
||||
const currentYear = new Date().getFullYear();
|
||||
|
||||
const config = useRuntimeConfig();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -40,8 +44,12 @@ const currentYear = new Date().getFullYear();
|
|||
<slot />
|
||||
</main>
|
||||
<footer class="flex h-12 shrink-0 items-center gap-2 border-b px-4" data-testid="footer">
|
||||
<div v-if="currentYear === 2025" class="bg-muted/50 flex-1 rounded-xl p-2 text-center">Glowing Fiesta 2025</div>
|
||||
<div v-else class="bg-muted/50 flex-1 rounded-xl p-2 text-center">Glowing Fiesta 2025 - {{ currentYear }}</div>
|
||||
<div v-if="currentYear === 2025" class="bg-muted/50 flex-1 rounded-xl p-2 text-center">
|
||||
Glowing Fiesta 2025 <span class="text-muted-foreground">({{ config.public.appVersion }})</span>
|
||||
</div>
|
||||
<div v-else class="bg-muted/50 flex-1 rounded-xl p-2 text-center">
|
||||
Glowing Fiesta 2025 - {{ currentYear }} <span class="text-muted-foreground">({{ config.public.appVersion }})</span>
|
||||
</div>
|
||||
</footer>
|
||||
</SidebarInset>
|
||||
</SidebarProvider>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue