update nostr-tools

This commit is contained in:
Shusui MOYATANI
2023-12-21 02:51:51 +09:00
parent 4df42cea0a
commit 47eb2fc57d
48 changed files with 216 additions and 162 deletions

View File

@@ -1,6 +1,7 @@
import { For, Switch, Match, type Component, Show } from 'solid-js';
import { Kind, type Event as NostrEvent } from 'nostr-tools';
import * as Kind from 'nostr-tools/kinds';
import { type Event as NostrEvent } from 'nostr-tools/pure';
import ColumnItem from '@/components/ColumnItem';
import Reaction from '@/components/event/Reaction';
@@ -20,18 +21,18 @@ const Notification: Component<NotificationProps> = (props) => {
{(event) => (
<Show when={!shouldMuteEvent(event)}>
<Switch fallback={<div>unknown event</div>}>
<Match when={event.kind === (Kind.Text as number)}>
<Match when={event.kind === Kind.ShortTextNote}>
<ColumnItem>
<TextNote event={event} />
</ColumnItem>
</Match>
<Match when={event.kind === (Kind.Reaction as number)}>
<Match when={event.kind === Kind.Reaction}>
<ColumnItem>
<Reaction event={event} />
</ColumnItem>
</Match>
{/* TODO ちゃんとnotification用のコンポーネント使う */}
<Match when={event.kind === (Kind.Repost as number)}>
<Match when={event.kind === Kind.Repost}>
<ColumnItem>
<Repost event={event} />
</ColumnItem>