Skip to content

Commit

Permalink
updated Posts.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
VanshikaSabharwal committed Oct 26, 2024
1 parent b4a147c commit f09e77d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
25 changes: 13 additions & 12 deletions src/screens/UserPortal/Posts/Posts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,18 +214,19 @@ export default function home(): JSX.Element {
id: value._id,
}));

const postComments: InterfacePostComments = comments.map((value) => ({
id: value.id, // Make sure this matches the '_id' type definition
creator: {
firstName: value.creator.firstName,
lastName: value.creator.lastName,
id: value.creator.id, // Use 'id' as per your type definition
email: value.creator.email,
},
likeCount: value.likeCount,
likedBy: value.likedBy.map((like) => ({ id: like.id })),
text: value.text,
}));
const postComments: InterfacePostComments =
comments?.map((value) => ({
id: value.id,
creator: {
firstName: value.creator?.firstName ?? '',
lastName: value.creator?.lastName ?? '',
id: value.creator?.id ?? '',
email: value.creator?.email ?? '',
},
likeCount: value.likeCount,
likedBy: value.likedBy?.map((like) => ({ id: like?.id ?? '' })) ?? [],
text: value.text,
})) ?? [];

const date = new Date(node.createdAt);
const formattedDate = new Intl.DateTimeFormat('en-US', {
Expand Down
2 changes: 1 addition & 1 deletion src/screens/UserPortal/UserScreen/UserScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ const UserScreen = (): JSX.Element => {
{/* Before */}
{/* <h1>{titleKey !== 'home' ? t('title') : ''}</h1> */}
{/* After */}
<h1>{titleKey !== 'home' ? t('title') : 'Posts'}</h1>
<h1>{titleKey !== 'home' ? t('title') : t('title')}</h1>
</div>
<ProfileDropdown />
</div>
Expand Down

0 comments on commit f09e77d

Please sign in to comment.