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"; import useLogin from "@/Hooks/useLogin";
export class MutedWordTag implements ToNostrEventTag { export class MutedWordTag implements ToNostrEventTag {
constructor(readonly word: string) { } constructor(readonly word: string) {}
equals(other: ToNostrEventTag): boolean { equals(other: ToNostrEventTag): boolean {
return other instanceof MutedWordTag && other.word === this.word; return other instanceof MutedWordTag && other.word === this.word;
} }

View File

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

View File

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