From ea5bb01c263efeadb6a672b16ae6957ec959f8c9 Mon Sep 17 00:00:00 2001 From: benthecarman Date: Tue, 2 Apr 2024 22:54:54 -0500 Subject: [PATCH] Handle default name in LabelCircle --- src/components/LabelCircle.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/LabelCircle.tsx b/src/components/LabelCircle.tsx index 203493ba..acfcc179 100644 --- a/src/components/LabelCircle.tsx +++ b/src/components/LabelCircle.tsx @@ -2,7 +2,7 @@ import { createResource, createSignal, JSX, Match, Switch } from "solid-js"; import { Dynamic } from "solid-js/web"; import avatar from "~/assets/generic-avatar.jpg"; -import { generateGradient } from "~/utils"; +import { DEFAULT_NOSTR_NAME, generateGradient } from "~/utils"; export function Circle(props: { children: JSX.Element; @@ -44,7 +44,7 @@ export function LabelCircle(props: { onClick?: () => void; }) { const [gradient] = createResource(async () => { - if (props.name && props.contact) { + if (props.name && props.name !== DEFAULT_NOSTR_NAME && props.contact) { return generateGradient(props.name || "?"); } else { return undefined; @@ -52,7 +52,10 @@ export function LabelCircle(props: { }); const text = () => - props.contact && props.name && props.name.length + props.contact && + props.name && + props.name.length && + props.name !== DEFAULT_NOSTR_NAME ? props.name[0] : props.label ? "≡"