setExpanded(!expanded)}
- className={'line-clamp-1 cursor-pointer pl-1 sm:pl-0'}
+ className={' flex cursor-pointer truncate pl-1 sm:pl-0'}
>
{sourceContractTitle ? (
-
- {'Activity on '}
-
-
+ <>
+
{'Activity on '}
+
+
+
+ >
) : (
'Other activity'
)}
@@ -560,6 +548,7 @@ function NotificationGroupItem(props: {
notification={notification}
key={notification.id}
justSummary={false}
+ hideTitle={true}
/>
))}
>
@@ -789,7 +778,7 @@ function NotificationLink(props: { notification: Notification }) {
: ''
}
className={
- 'ml-1 font-bold hover:underline hover:decoration-indigo-400 hover:decoration-2'
+ 'ml-1 inline max-w-xs truncate font-bold text-gray-500 hover:underline hover:decoration-indigo-400 hover:decoration-2 sm:max-w-sm'
}
>
{sourceContractTitle || sourceTitle}
@@ -842,8 +831,9 @@ function getSourceIdForLinkComponent(
function NotificationItem(props: {
notification: Notification
justSummary?: boolean
+ hideTitle?: boolean
}) {
- const { notification, justSummary } = props
+ const { notification, justSummary, hideTitle } = props
const {
sourceType,
sourceId,
@@ -892,10 +882,7 @@ function NotificationItem(props: {
{sourceType &&
reason &&
- getReasonForShowingNotification(notification, true).replace(
- ' on',
- ''
- )}
+ getReasonForShowingNotification(notification, true, true)}
)}
-
- {sourceType && reason && (
-
- {getReasonForShowingNotification(notification, false)}
+ {sourceType && reason && (
+
+
+ {getReasonForShowingNotification(notification, false, true)}
+
+ {!hideTitle && (
-
- )}
-
+ )}
+
+ )}
+ {sourceId &&
+ sourceContractSlug &&
+ sourceContractCreatorUsername ? (
+
+ ) : (
+
+ )}
- {sourceId && sourceContractSlug && sourceContractCreatorUsername ? (
-
- ) : (
-
- )}
@@ -1035,7 +1026,9 @@ function NotificationTextLabel(props: {
)
} else if ((sourceType === 'bonus' || sourceType === 'tip') && sourceText) {
return (
- {formatMoney(parseInt(sourceText))}
+
+ {'+' + formatMoney(parseInt(sourceText))}
+
)
}
// return default text
@@ -1048,7 +1041,8 @@ function NotificationTextLabel(props: {
function getReasonForShowingNotification(
notification: Notification,
- simple?: boolean
+ simple?: boolean,
+ replaceOn?: boolean
) {
const { sourceType, sourceUpdateType, sourceText, reason, sourceSlug } =
notification
@@ -1106,17 +1100,22 @@ function getReasonForShowingNotification(
case 'bonus':
if (reason === 'unique_bettors_on_your_contract' && sourceText)
reasonText = !simple
- ? `You had ${
+ ? `for ${
parseInt(sourceText) / UNIQUE_BETTOR_BONUS_AMOUNT
- } unique bettors on`
- : ' for unique bettors'
+ } unique bettors`
+ : ' for unique bettors on'
else reasonText = 'You earned your daily manna'
break
case 'tip':
- reasonText = !simple ? `tipped you on` : `in tips on`
+ reasonText = !simple ? `tipped you` : `in tips on`
break
default:
reasonText = ''
}
- return reasonText
+
+ return (
+
+ {replaceOn ? reasonText.replace(' on', '') : reasonText}
+
+ )
}