Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
Fix page error when no notification message (#452)
Browse files Browse the repository at this point in the history
  • Loading branch information
Emily-Ke authored Aug 26, 2022
1 parent a5b1220 commit a0539ff
Showing 1 changed file with 53 additions and 52 deletions.
105 changes: 53 additions & 52 deletions src/pages/notifications/Notifications.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,58 +100,59 @@ export default function Notifications() {
const createdDate = notification?.created;
const timeSince =
calculatePrettyTimeElapsedSince(createdDate);
const notificationText = (
<Text
key={notification?.guid}
style={{
color: read
? theme.palette.text.secondary
: theme.palette.text.primary,
}}
variant="body2"
>
{intl.formatMessage(
{
id: currentNotificationSchema?.notificationMessage,
},
{
userName: (
<span>
<Link
newTab
href={`/users/${userNameGuid}`}
>
{userName}
</Link>
</span>
),
user1Name,
user2Name,
yourIndividualName: (
<span>
<Link
newTab
href={`/individuals/${yourIndividualGuid}`}
>
{yourIndName}
</Link>
</span>
),
theirIndividualName: (
<span>
<Link
newTab
href={`/individuals/${theirIndividualGuid}`}
>
{theirIndividualName}
</Link>
</span>
),
formattedDeadline,
},
)}
</Text>
);
const notificationText =
currentNotificationSchema?.notificationMessage ? (
<Text
key={notification?.guid}
style={{
color: read
? theme.palette.text.secondary
: theme.palette.text.primary,
}}
variant="body2"
>
{intl.formatMessage(
{
id: currentNotificationSchema.notificationMessage,
},
{
userName: (
<span>
<Link
newTab
href={`/users/${userNameGuid}`}
>
{userName}
</Link>
</span>
),
user1Name,
user2Name,
yourIndividualName: (
<span>
<Link
newTab
href={`/individuals/${yourIndividualGuid}`}
>
{yourIndName}
</Link>
</span>
),
theirIndividualName: (
<span>
<Link
newTab
href={`/individuals/${theirIndividualGuid}`}
>
{theirIndividualName}
</Link>
</span>
),
formattedDeadline,
},
)}
</Text>
) : null;
const howLongAgoText = (
<Text
style={{
Expand Down

0 comments on commit a0539ff

Please sign in to comment.