Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Give all pages a title
Alexis Sellier committed 4 years ago
commit 5647050b800a9fed6c372fd3699115122e24e05f
parent 1879f983bd6310334996f68eeb8ef28a1dbda29b
13 files changed +71 -0
modified src/App.svelte
@@ -54,6 +54,10 @@
</style>

<svelte:window on:keydown={handleKeydown} />
+
<svelte:head>
+
  <title>Radicle</title>
+
</svelte:head>
+

<div class="app">
  {#await loadConfig}
    <!-- Loading wallet -->
modified src/base/home/Index.svelte
@@ -9,6 +9,10 @@
  };
</script>

+
<svelte:head>
+
  <title>Radicle &ndash; Home</title>
+
</svelte:head>
+

<main class="centered">
  <div>
    <input size="40" type="text" bind:value={input} placeholder="Enter a name, address or domain..." />
modified src/base/orgs/Index.svelte
@@ -54,6 +54,10 @@
  }
</style>

+
<svelte:head>
+
  <title>Radicle: Orgs</title>
+
</svelte:head>
+

<main>
  {#if account}
    <div class="my-orgs">
modified src/base/orgs/View.svelte
@@ -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 />
modified src/base/projects/View.svelte
@@ -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>
modified src/base/registrations/Index.svelte
@@ -34,6 +34,10 @@
  }
</style>

+
<svelte:head>
+
  <title>Radicle: Register</title>
+
</svelte:head>
+

<main class="centered">
  <div>
    <div class="input-caption">
modified src/base/registrations/New.svelte
@@ -58,6 +58,10 @@
  });
</script>

+
<svelte:head>
+
  <title>Radicle: Register {subdomain}</title>
+
</svelte:head>
+

<Modal narrow>
  <span slot="title">
    <div>🌐</div>
modified src/base/registrations/Submit.svelte
@@ -42,6 +42,10 @@
  }
</style>

+
<svelte:head>
+
  <title>{subdomain}</title>
+
</svelte:head>
+

{#if error}
  <Err
    title="Transaction failed"
modified src/base/registrations/View.svelte
@@ -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}
modified src/base/resolver/Query.svelte
@@ -48,6 +48,10 @@
  });
</script>

+
<svelte:head>
+
  <title>Radicle: {query}</title>
+
</svelte:head>
+

<main class="centered">
  {#if error}
    <Error on:close={() => navigate('/')}>
modified src/base/users/View.svelte
@@ -70,6 +70,10 @@
  }
</style>

+
<svelte:head>
+
  <title>{address}</title>
+
</svelte:head>
+

{#await Profile.get(address, ProfileType.Full, config)}
  <Loading fadeIn />
{:then profile}
modified src/base/vesting/Index.svelte
@@ -53,6 +53,10 @@
  }
</style>

+
<svelte:head>
+
  <title>Radicle &ndash; Vesting</title>
+
</svelte:head>
+

<main class="centered">
  <div>
    {#if info}
modified src/utils.ts
@@ -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);