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