@@ -39,66 +39,66 @@ export function NotificationItem(props: { notification: Notification }) {
3939 }
4040}
4141
42- export function CommentOnProfileNotification ( props : {
42+ export function BaseNotification ( props : {
4343 notification : Notification
4444 highlighted : boolean
4545 setHighlighted : ( highlighted : boolean ) => void
46- isChildOfGroup ?: boolean
4746} ) {
48- const { notification, isChildOfGroup, highlighted, setHighlighted } = props
49- const { sourceUserName, sourceUserUsername, sourceText } = notification
50- const reasonText = `commented `
47+ const { notification, highlighted, setHighlighted } = props
5148 return (
5249 < NotificationFrame
5350 notification = { notification }
54- isChildOfGroup = { isChildOfGroup }
5551 highlighted = { highlighted }
5652 setHighlighted = { setHighlighted }
5753 icon = {
58- < AvatarNotificationIcon notification = { notification } symbol = { '💬' } />
54+ < AvatarNotificationIcon notification = { notification } />
5955 }
6056 subtitle = {
6157 < div className = "line-clamp-2" >
62- < Linkify text = { sourceText } />
58+ < Linkify text = { notification . sourceText } />
6359 </ div >
6460 }
6561 link = { notification . sourceSlug }
6662 >
6763 < div className = "line-clamp-3" >
68- < NotificationUserLink
69- name = { sourceUserName }
70- username = { sourceUserUsername }
71- /> { ' ' }
72- { reasonText }
73- { ! isChildOfGroup && < span > on your profile</ span > }
64+ < span > { notification . title } </ span >
7465 </ div >
7566 </ NotificationFrame >
7667 )
7768}
7869
79- export function BaseNotification ( props : {
70+ export function CommentOnProfileNotification ( props : {
8071 notification : Notification
8172 highlighted : boolean
8273 setHighlighted : ( highlighted : boolean ) => void
74+ isChildOfGroup ?: boolean
8375} ) {
84- const { notification, highlighted, setHighlighted } = props
76+ const { notification, isChildOfGroup, highlighted, setHighlighted } = props
77+ const { sourceUserName, sourceUserUsername, sourceText } = notification
78+ const reasonText = `commented `
8579 return (
8680 < NotificationFrame
8781 notification = { notification }
82+ isChildOfGroup = { isChildOfGroup }
8883 highlighted = { highlighted }
8984 setHighlighted = { setHighlighted }
9085 icon = {
91- < AvatarNotificationIcon notification = { notification } />
86+ < AvatarNotificationIcon notification = { notification } symbol = { '💬' } />
9287 }
9388 subtitle = {
9489 < div className = "line-clamp-2" >
95- < Linkify text = { notification . sourceText } />
90+ < Linkify text = { sourceText } />
9691 </ div >
9792 }
9893 link = { notification . sourceSlug }
9994 >
10095 < div className = "line-clamp-3" >
101- < span > { notification . title } </ span >
96+ < NotificationUserLink
97+ name = { sourceUserName }
98+ username = { sourceUserUsername }
99+ /> { ' ' }
100+ { reasonText }
101+ { ! isChildOfGroup && < span > on your profile</ span > }
102102 </ div >
103103 </ NotificationFrame >
104104 )
@@ -281,9 +281,8 @@ export function AvatarNotificationIcon(props: {
281281 symbol ?: string | ReactNode
282282} ) {
283283 const { notification, symbol } = props
284- const { sourceUserName, sourceUserAvatarUrl, sourceUserUsername } =
285- notification
286- const href = `/${ sourceUserUsername } `
284+ const { sourceUserName, sourceUserAvatarUrl, sourceUserUsername, sourceSlug } = notification
285+ const href = ! ! sourceUserUsername ? `/${ sourceUserUsername } ` : sourceSlug ?? '/'
287286 return (
288287 < div className = "relative" >
289288 < Link
0 commit comments