Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

[APP-702] Render Custom Feed likes properly (#980)

* render href for custom feed likes properly

* fix custom feed text in push notification

* fix custom feed accessibility title

* fix lint

authored by

Ansh and committed by
GitHub
fe327300 99aa38e3

+25 -4
+4 -1
src/lib/notifee.ts
··· 1 1 import notifee, {EventType} from '@notifee/react-native' 2 - import {AppBskyEmbedImages} from '@atproto/api' 2 + import {AppBskyEmbedImages, AtUri} from '@atproto/api' 3 3 import {RootStoreModel} from 'state/models/root-store' 4 4 import {NotificationsFeedItemModel} from 'state/models/feeds/notifications' 5 5 import {enforceLen} from 'lib/strings/helpers' ··· 63 63 } else if (notification.isFollow) { 64 64 title = 'New follower!' 65 65 body = `${author} has followed you` 66 + } else if (notification.isCustomFeedLike) { 67 + title = `${author} liked your custom feed` 68 + body = `${new AtUri(notification.subjectUri).rkey}` 66 69 } else { 67 70 return 68 71 }
+7 -1
src/state/models/feeds/notifications.ts
··· 145 145 } 146 146 147 147 get isLike() { 148 - return this.reason === 'like' 148 + return this.reason === 'like' && !this.isCustomFeedLike // the reason property for custom feed likes is also 'like' 149 149 } 150 150 151 151 get isRepost() { ··· 166 166 167 167 get isFollow() { 168 168 return this.reason === 'follow' 169 + } 170 + 171 + get isCustomFeedLike() { 172 + return ( 173 + this.reason === 'like' && this.reasonSubject?.includes('feed.generator') 174 + ) 169 175 } 170 176 171 177 get needsAdditionalData() {
+12
src/view/com/notifications/FeedItem.tsx
··· 65 65 } else if (item.isReply) { 66 66 const urip = new AtUri(item.uri) 67 67 return `/profile/${urip.host}/post/${urip.rkey}` 68 + } else if (item.isCustomFeedLike) { 69 + const urip = new AtUri(item.subjectUri) 70 + return `/profile/${urip.host}/feed/${urip.rkey}` 68 71 } 69 72 return '' 70 73 }, [item]) ··· 75 78 return item.author.handle 76 79 } else if (item.isReply) { 77 80 return 'Post' 81 + } else if (item.isCustomFeedLike) { 82 + return 'Custom Feed' 78 83 } 79 84 }, [item]) 80 85 ··· 160 165 action = 'followed you' 161 166 icon = 'user-plus' 162 167 iconStyle = [s.blue3 as FontAwesomeIconStyle] 168 + } else if (item.isCustomFeedLike) { 169 + action = `liked your custom feed '${new AtUri(item.subjectUri).rkey}'` 170 + icon = 'HeartIconSolid' 171 + iconStyle = [ 172 + s.red3 as FontAwesomeIconStyle, 173 + {position: 'relative', top: -4}, 174 + ] 163 175 } else { 164 176 return null 165 177 }
+2 -2
src/view/com/pager/TabBar.tsx
··· 109 109 paddingHorizontal: 10, 110 110 borderBottomWidth: 3, 111 111 borderBottomColor: 'transparent', 112 - justifyContent: 'center' 112 + justifyContent: 'center', 113 113 }, 114 114 }) 115 115 : StyleSheet.create({ ··· 130 130 paddingHorizontal: isMobileWeb ? 8 : 0, 131 131 borderBottomWidth: 3, 132 132 borderBottomColor: 'transparent', 133 - justifyContent: 'center' 133 + justifyContent: 'center', 134 134 }, 135 135 })