chore: formatting
This commit is contained in:
parent
f2319b074f
commit
18a75a601b
@ -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;
|
||||
}
|
||||
|
@ -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,18 +107,19 @@ const AvatarSection = ({
|
||||
/>
|
||||
)}
|
||||
{canWrite && muted && <MuteButton pubkey={id} />}
|
||||
{canWrite && !muted && <IconButton
|
||||
className={muted ? "bg-success" : "!bg-error"}
|
||||
onClick={async () => {
|
||||
if (muted) {
|
||||
await unmute(id);
|
||||
} else {
|
||||
await mute(id);
|
||||
}
|
||||
}}
|
||||
icon={{ name: "mute", size: 16 }}
|
||||
/>
|
||||
}
|
||||
{canWrite && !muted && (
|
||||
<IconButton
|
||||
className={muted ? "bg-success" : "!bg-error"}
|
||||
onClick={async () => {
|
||||
if (muted) {
|
||||
await unmute(id);
|
||||
} else {
|
||||
await mute(id);
|
||||
}
|
||||
}}
|
||||
icon={{ name: "mute", size: 16 }}
|
||||
/>
|
||||
)}
|
||||
{!canWrite && !isMe && (
|
||||
<IconButton
|
||||
onClick={() => {
|
||||
@ -159,14 +154,14 @@ const AvatarSection = ({
|
||||
targets={
|
||||
lnurl?.lnurl && id
|
||||
? [
|
||||
{
|
||||
type: "lnurl",
|
||||
value: lnurl.lnurl,
|
||||
weight: 1,
|
||||
name: user?.display_name || user?.name,
|
||||
zap: { pubkey: id, anon: false },
|
||||
} as ZapTarget,
|
||||
]
|
||||
{
|
||||
type: "lnurl",
|
||||
value: lnurl.lnurl,
|
||||
weight: 1,
|
||||
name: user?.display_name || user?.name,
|
||||
zap: { pubkey: id, anon: false },
|
||||
} as ZapTarget,
|
||||
]
|
||||
: undefined
|
||||
}
|
||||
show={showLnQr}
|
||||
|
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user