Use PLATFORM_NAME instead of hard-coding the app name
This commit is contained in:
parent
e04516f4f0
commit
b1117d601a
3 changed files with 5 additions and 7 deletions
|
|
@ -126,6 +126,7 @@ callbacks and hot paths.
|
||||||
**CRITICAL Code Style Guidelines:**
|
**CRITICAL Code Style Guidelines:**
|
||||||
|
|
||||||
- **No `null`** - only use `undefined`
|
- **No `null`** - only use `undefined`
|
||||||
|
- Never hard-code the app's name. The brand is a build-time `VITE_PLATFORM_*` variable, so user-facing copy interpolates `PLATFORM_NAME` from `@app/env`, and `PLATFORM_URL`, `PLATFORM_LOGO`, `PLATFORM_ABOUT` for the rest of it. Each is set by the deployment, so don't write a `"Flotilla"` fallback behind one either.
|
||||||
- Svelte 5 runes (`$state`, `$derived`, `$effect`) only in UI components
|
- Svelte 5 runes (`$state`, `$derived`, `$effect`) only in UI components
|
||||||
- TailwindCSS styling with css components customized by theme. See lib/components for examples.
|
- TailwindCSS styling with css components customized by theme. See lib/components for examples.
|
||||||
- Comments, naming, conditionals and single-use indirection are covered by the Cleanup Pass above.
|
- Comments, naming, conditionals and single-use indirection are covered by the Cleanup Pass above.
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
import {user} from "@app/core"
|
import {user} from "@app/core"
|
||||||
import {pushModal} from "@app/modal"
|
import {pushModal} from "@app/modal"
|
||||||
import {HostingError, listTenantRelays, type HostedRelay} from "@app/hosting"
|
import {HostingError, listTenantRelays, type HostedRelay} from "@app/hosting"
|
||||||
|
import {PLATFORM_NAME} from "@app/env"
|
||||||
|
|
||||||
const {class: className = ""}: {class?: string} = $props()
|
const {class: className = ""}: {class?: string} = $props()
|
||||||
|
|
||||||
|
|
@ -58,8 +59,8 @@
|
||||||
{#if relays.length > 0}
|
{#if relays.length > 0}
|
||||||
Spin up another hosted space — rooms, calendar and moderation included.
|
Spin up another hosted space — rooms, calendar and moderation included.
|
||||||
{:else}
|
{:else}
|
||||||
Don't wait for an invite. Flotilla Hosting sets up a space with rooms, calendar and
|
Don't wait for an invite. {PLATFORM_NAME} Hosting sets up a space with rooms, calendar and moderation
|
||||||
moderation in about a minute.
|
in about a minute.
|
||||||
{/if}
|
{/if}
|
||||||
</p>
|
</p>
|
||||||
<Button class="button button-primary button-sm" onclick={openCreate}>
|
<Button class="button button-primary button-sm" onclick={openCreate}>
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,6 @@ import {app, profiles, rooms} from "@app/core"
|
||||||
import {PLATFORM_NAME} from "@app/env"
|
import {PLATFORM_NAME} from "@app/env"
|
||||||
import {decodeRelay} from "@app/relays"
|
import {decodeRelay} from "@app/relays"
|
||||||
|
|
||||||
const FALLBACK_APP_NAME = "Flotilla"
|
|
||||||
|
|
||||||
const staticTitles = new Map<string, string>([
|
const staticTitles = new Map<string, string>([
|
||||||
["/", "Redirecting"],
|
["/", "Redirecting"],
|
||||||
["/home", "Home"],
|
["/home", "Home"],
|
||||||
|
|
@ -108,9 +106,7 @@ export const makeTitle = (...parts: Array<string | undefined>) =>
|
||||||
parts
|
parts
|
||||||
.map(part => part?.trim() || "")
|
.map(part => part?.trim() || "")
|
||||||
.filter(identity)
|
.filter(identity)
|
||||||
.join(" · ") ||
|
.join(" · ") || PLATFORM_NAME
|
||||||
PLATFORM_NAME ||
|
|
||||||
FALLBACK_APP_NAME
|
|
||||||
|
|
||||||
export const getPageTitle = ({page, pubkey}: PageTitleContext) => {
|
export const getPageTitle = ({page, pubkey}: PageTitleContext) => {
|
||||||
const routeId = page.route.id || ""
|
const routeId = page.route.id || ""
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue