grain.social is a photo sharing platform built on atproto.

feat: reply notification type

Changed files
+19 -3
__generated__
types
social
grain
notification
lexicons
social
grain
notification
src
+1
__generated__/lexicons.ts
··· 2449 'follow', 2450 'gallery-favorite', 2451 'gallery-comment', 2452 'unknown', 2453 ], 2454 },
··· 2449 'follow', 2450 'gallery-favorite', 2451 'gallery-comment', 2452 + 'reply', 2453 'unknown', 2454 ], 2455 },
+1
__generated__/types/social/grain/notification/defs.ts
··· 25 | 'follow' 26 | 'gallery-favorite' 27 | 'gallery-comment' 28 | 'unknown' 29 | (string & {}) 30 reasonSubject?: string
··· 25 | 'follow' 26 | 'gallery-favorite' 27 | 'gallery-comment' 28 + | 'reply' 29 | 'unknown' 30 | (string & {}) 31 reasonSubject?: string
+1
lexicons/social/grain/notification/defs.json
··· 27 "follow", 28 "gallery-favorite", 29 "gallery-comment", 30 "unknown" 31 ] 32 },
··· 27 "follow", 28 "gallery-favorite", 29 "gallery-comment", 30 + "reply", 31 "unknown" 32 ] 33 },
+11 -3
src/components/NotificationsPage.tsx
··· 62 )} 63 </> 64 )} 65 {notification.reason === "follow" && ( 66 <> 67 followed you · {formatRelativeTime( ··· 85 </div> 86 ) 87 : null} 88 - {notification.reason === "gallery-comment" && galleriesMap.get( 89 - (notification.record as Comment).subject, 90 - ) 91 ? ( 92 <> 93 {(notification.record as Comment).text}
··· 62 )} 63 </> 64 )} 65 + {notification.reason === "reply" && ( 66 + <> 67 + replied to your comment · {formatRelativeTime( 68 + new Date((notification.record as Comment).createdAt), 69 + )} 70 + </> 71 + )} 72 {notification.reason === "follow" && ( 73 <> 74 followed you · {formatRelativeTime( ··· 92 </div> 93 ) 94 : null} 95 + {(notification.reason === "gallery-comment" || 96 + notification.reason === "reply") && galleriesMap.get( 97 + (notification.record as Comment).subject, 98 + ) 99 ? ( 100 <> 101 {(notification.record as Comment).text}
+5
src/lib/notifications.ts
··· 45 reason = "gallery-favorite"; 46 } else if (record.$type === "social.grain.graph.follow") { 47 reason = "follow"; 48 } else if (record.$type === "social.grain.comment") { 49 reason = "gallery-comment"; 50 } else {
··· 45 reason = "gallery-favorite"; 46 } else if (record.$type === "social.grain.graph.follow") { 47 reason = "follow"; 48 + } else if ( 49 + record.$type === "social.grain.comment" && 50 + record.replyTo 51 + ) { 52 + reason = "reply"; 53 } else if (record.$type === "social.grain.comment") { 54 reason = "gallery-comment"; 55 } else {