From 177e4c1ff72ce1291b67806e06f06a8b669ec3ed Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Fri, 8 Sep 2023 15:29:41 +0700 Subject: [PATCH] fix some bugs --- src/app/notifications/components/mention.tsx | 29 ++++------- src/app/notifications/components/reaction.tsx | 29 +++++------ src/app/notifications/components/repost.tsx | 35 ++++++------- src/app/notifications/components/user.tsx | 6 +-- src/app/notifications/index.tsx | 52 ++++++++++++++----- src/app/space/index.tsx | 3 ++ src/app/splash.tsx | 8 +-- src/shared/navigation.tsx | 24 +++++++-- src/shared/notes/kinds/repost.tsx | 2 +- src/shared/notes/kinds/text.tsx | 2 +- src/shared/widgets/local/follows.tsx | 6 +-- src/stores/activities.ts | 38 +++++++------- src/utils/hooks/useEvent.ts | 2 +- src/utils/parser.ts | 25 +++++---- 14 files changed, 142 insertions(+), 119 deletions(-) diff --git a/src/app/notifications/components/mention.tsx b/src/app/notifications/components/mention.tsx index d9ed7caf..1f681e36 100644 --- a/src/app/notifications/components/mention.tsx +++ b/src/app/notifications/components/mention.tsx @@ -1,32 +1,25 @@ import { NDKEvent } from '@nostr-dev-kit/ndk'; -import { useMemo } from 'react'; +import { Link } from 'react-router-dom'; -import { NotiContent } from '@app/notifications/components/content'; import { NotiUser } from '@app/notifications/components/user'; import { formatCreatedAt } from '@utils/createdAt'; -import { parser } from '@utils/parser'; export function NotiMention({ event }: { event: NDKEvent }) { const createdAt = formatCreatedAt(event.created_at); - const content = useMemo(() => parser(event), [event]); + const rootId = event.tags.find((el) => el[0])?.[1]; return ( -
has reply you post · {createdAt}
-has mention you · {createdAt}
- reacted {event.content} · {createdAt} -
-+ reacted {event.content} · {createdAt} +
- repost{' '} - {event.pubkey !== db.account.pubkey - ? 'a post that mention you' - : 'your post'}{' '} - · {createdAt} -
-+ repost{' '} + {event.pubkey !== db.account.pubkey ? 'a post that mention you' : 'your post'}{' '} + · {createdAt} +
🎉
-- Yo!, no new activities around you in the last 24 hours -
+Loading
🎉
++ Yo!, no new activities around you in the last 24 hours +
+