mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-21 22:30:41 +08:00
Give all pages a title
Signed-off-by: Alexis Sellier <self@cloudhead.io>
This commit is contained in:
@@ -54,6 +54,10 @@
|
||||
</style>
|
||||
|
||||
<svelte:window on:keydown={handleKeydown} />
|
||||
<svelte:head>
|
||||
<title>Radicle</title>
|
||||
</svelte:head>
|
||||
|
||||
<div class="app">
|
||||
{#await loadConfig}
|
||||
<!-- Loading wallet -->
|
||||
|
||||
@@ -9,6 +9,10 @@
|
||||
};
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>Radicle – Home</title>
|
||||
</svelte:head>
|
||||
|
||||
<main class="centered">
|
||||
<div>
|
||||
<input size="40" type="text" bind:value={input} placeholder="Enter a name, address or domain..." />
|
||||
|
||||
@@ -54,6 +54,10 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<svelte:head>
|
||||
<title>Radicle: Orgs</title>
|
||||
</svelte:head>
|
||||
|
||||
<main>
|
||||
{#if account}
|
||||
<div class="my-orgs">
|
||||
|
||||
@@ -126,6 +126,10 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<svelte:head>
|
||||
<title>{utils.formatOrg(address, config)}</title>
|
||||
</svelte:head>
|
||||
|
||||
{#await Org.get(address, config)}
|
||||
<main class="centered">
|
||||
<Loading center />
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
import Avatar from '@app/Avatar.svelte';
|
||||
import { Org } from '@app/base/orgs/Org';
|
||||
import type { Profile } from '@app/profile';
|
||||
import type { Info } from '@app/project';
|
||||
import { formatOrg } from '@app/utils';
|
||||
|
||||
import Browser from './Browser.svelte';
|
||||
|
||||
@@ -16,6 +18,8 @@
|
||||
export let config: Config;
|
||||
export let path: string;
|
||||
|
||||
let pageTitle = `${formatOrg(org, config)}/${urn}`;
|
||||
let projectInfo: Info | null = null;
|
||||
let projectRoot = proj.path({ urn, org, commit });
|
||||
let getProject = new Promise<Profile | null>(resolve => {
|
||||
if (org) {
|
||||
@@ -27,9 +31,20 @@
|
||||
const seed = orgProfile?.seed;
|
||||
const cfg = seed ? config.withSeed(seed) : config;
|
||||
const info = await proj.getInfo(urn, cfg);
|
||||
|
||||
projectInfo = info;
|
||||
|
||||
return { project: info, config: cfg, org: orgProfile };
|
||||
});
|
||||
|
||||
$: if (projectInfo) {
|
||||
if (projectInfo.meta.description) {
|
||||
pageTitle = `${formatOrg(org, config)}/${projectInfo.meta.name}: ${projectInfo.meta.description}`;
|
||||
} else {
|
||||
pageTitle = `${formatOrg(org, config)}/${projectInfo.meta.name}`;
|
||||
}
|
||||
}
|
||||
|
||||
const back = () => window.history.back();
|
||||
</script>
|
||||
|
||||
@@ -77,6 +92,10 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<svelte:head>
|
||||
<title>{pageTitle}</title>
|
||||
</svelte:head>
|
||||
|
||||
<main>
|
||||
{#await getProject}
|
||||
<header>
|
||||
|
||||
@@ -34,6 +34,10 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<svelte:head>
|
||||
<title>Radicle: Register</title>
|
||||
</svelte:head>
|
||||
|
||||
<main class="centered">
|
||||
<div>
|
||||
<div class="input-caption">
|
||||
|
||||
@@ -58,6 +58,10 @@
|
||||
});
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>Radicle: Register {subdomain}</title>
|
||||
</svelte:head>
|
||||
|
||||
<Modal narrow>
|
||||
<span slot="title">
|
||||
<div>🌐</div>
|
||||
|
||||
@@ -42,6 +42,10 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<svelte:head>
|
||||
<title>{subdomain}</title>
|
||||
</svelte:head>
|
||||
|
||||
{#if error}
|
||||
<Err
|
||||
title="Transaction failed"
|
||||
|
||||
@@ -124,6 +124,10 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<svelte:head>
|
||||
<title>{subdomain}.{config.registrar.domain}</title>
|
||||
</svelte:head>
|
||||
|
||||
{#if state.status === Status.Loading}
|
||||
<Loading />
|
||||
{:else if state.status === Status.Failed}
|
||||
|
||||
@@ -48,6 +48,10 @@
|
||||
});
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>Radicle: {query}</title>
|
||||
</svelte:head>
|
||||
|
||||
<main class="centered">
|
||||
{#if error}
|
||||
<Error on:close={() => navigate('/')}>
|
||||
|
||||
@@ -70,6 +70,10 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<svelte:head>
|
||||
<title>{address}</title>
|
||||
</svelte:head>
|
||||
|
||||
{#await Profile.get(address, ProfileType.Full, config)}
|
||||
<Loading fadeIn />
|
||||
{:then profile}
|
||||
|
||||
@@ -53,6 +53,10 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<svelte:head>
|
||||
<title>Radicle – Vesting</title>
|
||||
</svelte:head>
|
||||
|
||||
<main class="centered">
|
||||
<div>
|
||||
{#if info}
|
||||
|
||||
@@ -76,6 +76,14 @@ export function formatNetwork(input: { name: string }): string {
|
||||
return capitalize(name);
|
||||
}
|
||||
|
||||
export function formatOrg(input: string, config: Config): string {
|
||||
if (isAddress(input)) {
|
||||
return formatAddress(input);
|
||||
} else {
|
||||
return parseEnsLabel(input, config);
|
||||
}
|
||||
}
|
||||
|
||||
export function capitalize(s: string): string {
|
||||
if (s === "") return s;
|
||||
return s[0].toUpperCase() + s.substr(1);
|
||||
|
||||
Reference in New Issue
Block a user