chore: formatting

This commit is contained in:
2024-09-09 14:29:02 +01:00
parent f2319b074f
commit 18a75a601b
3 changed files with 27 additions and 32 deletions

View File

@ -4,7 +4,7 @@ import { EventKind, NostrEvent, NostrLink, TaggedNostrEvent, ToNostrEventTag, Un
import useLogin from "@/Hooks/useLogin";
export class MutedWordTag implements ToNostrEventTag {
constructor(readonly word: string) { }
constructor(readonly word: string) {}
equals(other: ToNostrEventTag): boolean {
return other instanceof MutedWordTag && other.word === this.word;
}

View File

@ -53,9 +53,7 @@ const AvatarSection = ({
if (prefix === NostrPrefix.PublicKey) {
return hexToBech32(NostrPrefix.PublicKey, id);
} else if (prefix === NostrPrefix.Profile) {
return NostrLink.profile(id, relays?.relays
.filter(a => a.settings.write)
.map(a => a.url)).encode();
return NostrLink.profile(id, relays?.relays.filter(a => a.settings.write).map(a => a.url)).encode();
}
}, [id, relays, prefix]);
@ -70,12 +68,8 @@ const AvatarSection = ({
<ProfileImage pubkey={id} />
<div className="flex flex-col items-center gap-3">
<div className="grid gap-2 grid-cols-2">
<AsyncButton onClick={() => setPrefix(NostrPrefix.PublicKey)}>
NPUB
</AsyncButton>
<AsyncButton onClick={() => setPrefix(NostrPrefix.Profile)}>
NPROFILE
</AsyncButton>
<AsyncButton onClick={() => setPrefix(NostrPrefix.PublicKey)}>NPUB</AsyncButton>
<AsyncButton onClick={() => setPrefix(NostrPrefix.Profile)}>NPROFILE</AsyncButton>
</div>
<QrCode data={`nostr:${profileId}`} />
<Copy text={profileId ?? ""} />
@ -113,7 +107,8 @@ const AvatarSection = ({
/>
)}
{canWrite && muted && <MuteButton pubkey={id} />}
{canWrite && !muted && <IconButton
{canWrite && !muted && (
<IconButton
className={muted ? "bg-success" : "!bg-error"}
onClick={async () => {
if (muted) {
@ -124,7 +119,7 @@ const AvatarSection = ({
}}
icon={{ name: "mute", size: 16 }}
/>
}
)}
{!canWrite && !isMe && (
<IconButton
onClick={() => {

View File

@ -16,8 +16,8 @@ module.exports = {
"nostr-red": "var(--heart)",
"nostr-purple": "var(--highlight)",
secondary: "var(--font-secondary-color)",
"warning": "var(--warning)",
"error": "var(--error)"
warning: "var(--warning)",
error: "var(--error)",
},
spacing: {
px: "1px",