Skip to content

Commit

Permalink
refactor: Simplify notification type handling by removing explicit ty…
Browse files Browse the repository at this point in the history
…pe casting
  • Loading branch information
bigint committed Mar 2, 2025
1 parent b65ff11 commit 026c522
Showing 1 changed file with 6 additions and 24 deletions.
30 changes: 6 additions & 24 deletions apps/web/src/components/Notification/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ import { NotificationFeedType } from "@hey/data/enums";
import {
type NotificationRequest,
NotificationType,
type CommentNotification as TCommentNotification,
type FollowNotification as TFollowNotification,
type MentionNotification as TMentionNotification,
type QuoteNotification as TQuoteNotification,
type ReactionNotification as TReactionNotification,
type RepostNotification as TRepostNotification,
useNotificationsQuery
} from "@hey/indexer";
import { Card, EmptyState, ErrorMessage } from "@hey/ui";
Expand Down Expand Up @@ -107,34 +101,22 @@ const List: FC<ListProps> = ({ feedType }) => {
})}
>
{notification.__typename === "FollowNotification" && (
<FollowNotification
notification={notification as TFollowNotification}
/>
<FollowNotification notification={notification} />
)}
{notification.__typename === "MentionNotification" && (
<MentionNotification
notification={notification as TMentionNotification}
/>
<MentionNotification notification={notification} />
)}
{notification.__typename === "ReactionNotification" && (
<ReactionNotification
notification={notification as TReactionNotification}
/>
<ReactionNotification notification={notification} />
)}
{notification.__typename === "CommentNotification" && (
<CommentNotification
notification={notification as TCommentNotification}
/>
<CommentNotification notification={notification} />
)}
{notification.__typename === "RepostNotification" && (
<RepostNotification
notification={notification as TRepostNotification}
/>
<RepostNotification notification={notification} />
)}
{notification.__typename === "QuoteNotification" && (
<QuoteNotification
notification={notification as TQuoteNotification}
/>
<QuoteNotification notification={notification} />
)}
</div>
)}
Expand Down

0 comments on commit 026c522

Please sign in to comment.