From 234c5228b024eac14d2cf25c08579aeda334658f Mon Sep 17 00:00:00 2001 From: codytseng Date: Fri, 26 Dec 2025 20:41:02 +0800 Subject: [PATCH] feat: add more trust score badge --- .../NotificationItem/Notification.tsx | 13 ++++++++++++- src/components/TrustScoreBadge/index.tsx | 16 +++++++++++++--- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/components/NotificationList/NotificationItem/Notification.tsx b/src/components/NotificationList/NotificationItem/Notification.tsx index 531c394..0545de3 100644 --- a/src/components/NotificationList/NotificationItem/Notification.tsx +++ b/src/components/NotificationList/NotificationItem/Notification.tsx @@ -1,6 +1,7 @@ import ContentPreview from '@/components/ContentPreview' import { FormattedTimestamp } from '@/components/FormattedTimestamp' import StuffStats from '@/components/StuffStats' +import TrustScoreBadge from '@/components/TrustScoreBadge' import { Skeleton } from '@/components/ui/skeleton' import UserAvatar from '@/components/UserAvatar' import Username from '@/components/Username' @@ -62,7 +63,16 @@ export default function Notification({ onClick={handleClick} >
- +
+ + +
{icon} {middle} {targetEvent && ( @@ -99,6 +109,7 @@ export default function Notification({ className="flex-1 max-w-fit truncate font-semibold" skeletonClassName="h-4" /> +
{description}
{unread && ( diff --git a/src/components/TrustScoreBadge/index.tsx b/src/components/TrustScoreBadge/index.tsx index e9e24af..b627dc0 100644 --- a/src/components/TrustScoreBadge/index.tsx +++ b/src/components/TrustScoreBadge/index.tsx @@ -8,10 +8,14 @@ import { useTranslation } from 'react-i18next' export default function TrustScoreBadge({ pubkey, - className + className, + classNames }: { pubkey: string className?: string + classNames?: { + container?: string + } }) { const { t } = useTranslation() const { isUserTrusted } = useUserTrust() @@ -54,7 +58,10 @@ export default function TrustScoreBadge({ // percentile < 60: suspicious (yellow warning) if (percentile < 40) { return ( -
+
) @@ -62,7 +69,10 @@ export default function TrustScoreBadge({ if (percentile < 60) { return ( -
+
)