mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-21 22:30:41 +08:00
Refactor how we pass around DIDs
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { createIcon } from "@app/lib/blockies";
|
||||
|
||||
export let nodeId: string;
|
||||
export let publicKey: string;
|
||||
|
||||
function createContainer(source: string) {
|
||||
const seed = source.toLowerCase();
|
||||
@@ -27,4 +27,8 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<img title={nodeId} src={createContainer(nodeId)} class="avatar" alt="avatar" />
|
||||
<img
|
||||
title={publicKey}
|
||||
src={createContainer(publicKey)}
|
||||
class="avatar"
|
||||
alt="avatar" />
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import type { Issue } from "@bindings/Issue";
|
||||
|
||||
import {
|
||||
authorForNodeId,
|
||||
formatOid,
|
||||
formatTimestamp,
|
||||
issueStatusBackgroundColor,
|
||||
@@ -68,9 +69,7 @@
|
||||
style:align-items="flex-start">
|
||||
<InlineTitle content={issue.title} />
|
||||
<div class="global-flex txt-small">
|
||||
<NodeId
|
||||
nodeId={issue.author.did.replace("did:key:", "")}
|
||||
alias={issue.author.alias} />
|
||||
<NodeId {...authorForNodeId(issue.author)} />
|
||||
opened
|
||||
<div class="global-oid">{formatOid(issue.id)}</div>
|
||||
{formatTimestamp(issue.timestamp)}
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
|
||||
import Avatar from "./Avatar.svelte";
|
||||
|
||||
export let nodeId: string;
|
||||
export let publicKey: string;
|
||||
export let alias: string | undefined = undefined;
|
||||
|
||||
export let styleFontSize: string | undefined = "var(--font-size-small)";
|
||||
export let styleFontFamily: string | undefined =
|
||||
"var(--font-family-monospace)";
|
||||
@@ -26,14 +27,14 @@
|
||||
class="avatar-alias"
|
||||
style:font-size={styleFontSize}
|
||||
style:font-family={styleFontFamily}>
|
||||
<Avatar {nodeId} />
|
||||
<Avatar {publicKey} />
|
||||
{#if alias}
|
||||
<span class="txt-overflow">
|
||||
{alias}
|
||||
</span>
|
||||
{:else}
|
||||
<span class="no-alias">
|
||||
{truncateId(nodeId)}
|
||||
{truncateId(publicKey)}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import type { Stats } from "@bindings/Stats";
|
||||
|
||||
import {
|
||||
authorForNodeId,
|
||||
formatOid,
|
||||
formatTimestamp,
|
||||
patchStatusBackgroundColor,
|
||||
@@ -82,9 +83,7 @@
|
||||
style:align-items="flex-start">
|
||||
<InlineTitle content={patch.title} />
|
||||
<div class="global-flex txt-small">
|
||||
<NodeId
|
||||
nodeId={patch.author.did.replace("did:key:", "")}
|
||||
alias={patch.author.alias} />
|
||||
<NodeId {...authorForNodeId(patch.author)} />
|
||||
opened
|
||||
<div class="global-oid">{formatOid(patch.id)}</div>
|
||||
{formatTimestamp(patch.timestamp)}
|
||||
|
||||
Reference in New Issue
Block a user