Skip to content

Commit

Permalink
Add user boost notification support
Browse files Browse the repository at this point in the history
  • Loading branch information
msantang78 committed Oct 24, 2024
1 parent 6d12046 commit c1d1b4c
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/notifications/v3/notification/content/ContentPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import {
import useNotificationRouter from '../useNotificationRouter';
import GroupsListItem from '~/groups/GroupsListItem';
import sp from '~/services/serviceProvider';
import UserModel from '~/channel/UserModel';
import ChannelListItem from '~/common/components/ChannelListItem';

type PropsType = {
notification: NotificationModel;
Expand Down Expand Up @@ -120,13 +122,15 @@ const renderContent = (notification: NotificationModel, navigation: any) => {
/>
);
} else {
return (
const entity = notification.type.startsWith('boost_')
? notification.entity.entity
: notification.entity;

return entity.type === 'user' ? (
<ChannelListItem channel={UserModel.create(entity)} />
) : (
<Activity
entity={ActivityModel.create(
notification.type.startsWith('boost_')
? notification.entity.entity
: notification.entity,
)}
entity={ActivityModel.create(entity)}
navigation={navigation}
autoHeight={false}
showOnlyContent={true}
Expand Down

0 comments on commit c1d1b4c

Please sign in to comment.