Use org name when available, otherwise address

Signed-off-by: Alexis Sellier <self@cloudhead.io>
This commit is contained in:
Alexis Sellier
2021-09-22 10:50:17 +02:00
parent abc62b02fd
commit 1879f983bd
4 changed files with 8 additions and 3 deletions
+1 -1
View File
@@ -61,7 +61,7 @@
<div class="list">
{#each profiles as profile}
<div class="org">
<Link to={`/orgs/${profile.address}`}>
<Link to={`/orgs/${profile.nameOrAddress}`}>
<div class="org-avatar">
<Avatar source={profile.avatar ?? profile.address} />
</div>
+1 -1
View File
@@ -252,7 +252,7 @@
{:then projects}
{#each projects as project}
<div class="project">
<Project {project} org={profile.name ?? org.address} config={profile.config(config)} />
<Project {project} org={profile.nameOrAddress} config={profile.config(config)} />
</div>
{/each}
{:catch err}
+1 -1
View File
@@ -86,7 +86,7 @@
<header>
<div class="title bold">
{#if result.org}
<a class="org-avatar" title={result.org.name || result.org.address} href={`/orgs/${org}`}>
<a class="org-avatar" title={result.org.nameOrAddress} href={`/orgs/${result.org.nameOrAddress}`}>
<Avatar source={result.org.avatar || org}/>
</a>
<span class="divider">/</span>
+5
View File
@@ -79,6 +79,11 @@ export class Profile {
return this.profile?.ens?.seedHost ?? undefined;
}
// Get the name, and if not available, the address.
get nameOrAddress(): string {
return this.name ?? this.address;
}
// Return the profile-specific config. This sets various URLs in the config,
// based on profile data.
config(config: Config): Config {