feat: add dev badge in navigation for local builds

This commit is contained in:
Sam 2023-03-30 01:20:46 +02:00
parent a49dd09013
commit 65fa7f6d46
No known key found for this signature in database
GPG Key ID: B4EF20DDE721CAA1
2 changed files with 9 additions and 2 deletions

View File

@ -26,7 +26,7 @@
<div class="d-flex flex-column min-vh-100">
<div class="flex-grow-1">
<Navigation />
<Navigation commit={data.git_commit} />
<div class="container">
<slot />
<div class="position-absolute top-0 start-50 translate-middle-x">

View File

@ -27,6 +27,8 @@
import { apiFetch, apiFetchClient } from "$lib/api/fetch";
import { addToast } from "$lib/toast";
export let commit: string;
let theme: string;
let currentUser: MeUser | null;
let showMenu: boolean = false;
@ -113,7 +115,12 @@
expand="lg"
class="mb-4"
>
<NavbarBrand href="/" aria-label="pronouns.cc landing page"><Logo /></NavbarBrand>
<NavbarBrand href="/" aria-label="pronouns.cc landing page">
<Logo />
{#if commit === "[unknown]"}
<Badge color="danger">DEV</Badge>
{/if}
</NavbarBrand>
<NavbarToggler on:click={toggleMenu} aria-label="Toggle menu" />
<Collapse isOpen={showMenu} navbar expand="lg">
<Nav class="ms-auto" navbar>