about summary refs log tree commit diff
path: root/src/view/com/notifications/FeedItem.tsx
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-04-12 18:26:38 -0700
committerGitHub <noreply@github.com>2023-04-12 18:26:38 -0700
commit2fed6c402159c6084dd481ab87c5e8b034e910ac (patch)
tree5907b2b67c900ef78de89e12ad9ae4c0d5ef6715 /src/view/com/notifications/FeedItem.tsx
parenta20d034ba5b18c4512f3a36f733bb5cd2199424e (diff)
downloadvoidsky-2fed6c402159c6084dd481ab87c5e8b034e910ac.tar.zst
Add first round of labeling tools (#467)
* Rework notifications to sync locally in full and give users better control

* Fix positioning of load more btn on web

* Improve behavior of load more notifications btn

* Fix to post rendering

* Fix notification fetch abort condition

* Add start of post-hiding by labels

* Create a standard postcontainer and improve show/hide UI on posts

* Add content hiding to expanded post form

* Improve label rendering to give more context to users when appropriate

* Fix rendering bug

* Add user/profile labeling

* Implement content filtering preferences

* Filter notifications by content prefs

* Update test-pds config

* Bump deps
Diffstat (limited to 'src/view/com/notifications/FeedItem.tsx')
-rw-r--r--src/view/com/notifications/FeedItem.tsx23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/view/com/notifications/FeedItem.tsx b/src/view/com/notifications/FeedItem.tsx
index e77eae17e..22a354da0 100644
--- a/src/view/com/notifications/FeedItem.tsx
+++ b/src/view/com/notifications/FeedItem.tsx
@@ -8,7 +8,7 @@ import {
   View,
 } from 'react-native'
 import {AppBskyEmbedImages} from '@atproto/api'
-import {AtUri} from '@atproto/api'
+import {AtUri, ComAtprotoLabelDefs} from '@atproto/api'
 import {
   FontAwesomeIcon,
   FontAwesomeIconStyle,
@@ -38,6 +38,7 @@ interface Author {
   handle: string
   displayName?: string
   avatar?: string
+  labels?: ComAtprotoLabelDefs.Label[]
 }
 
 export const FeedItem = observer(function FeedItem({
@@ -129,6 +130,7 @@ export const FeedItem = observer(function FeedItem({
       handle: item.author.handle,
       displayName: item.author.displayName,
       avatar: item.author.avatar,
+      labels: item.author.labels,
     },
   ]
   if (item.additional?.length) {
@@ -138,6 +140,7 @@ export const FeedItem = observer(function FeedItem({
         handle: item2.author.handle,
         displayName: item2.author.displayName,
         avatar: item2.author.avatar,
+        labels: item.author.labels,
       })),
     )
   }
@@ -255,7 +258,11 @@ function CondensedAuthorsList({
           href={authors[0].href}
           title={`@${authors[0].handle}`}
           asAnchor>
-          <UserAvatar size={35} avatar={authors[0].avatar} />
+          <UserAvatar
+            size={35}
+            avatar={authors[0].avatar}
+            hasWarning={!!authors[0].labels?.length}
+          />
         </Link>
       </View>
     )
@@ -264,7 +271,11 @@ function CondensedAuthorsList({
     <View style={styles.avis}>
       {authors.slice(0, MAX_AUTHORS).map(author => (
         <View key={author.href} style={s.mr5}>
-          <UserAvatar size={35} avatar={author.avatar} />
+          <UserAvatar
+            size={35}
+            avatar={author.avatar}
+            hasWarning={!!author.labels?.length}
+          />
         </View>
       ))}
       {authors.length > MAX_AUTHORS ? (
@@ -317,7 +328,11 @@ function ExpandedAuthorsList({
           style={styles.expandedAuthor}
           asAnchor>
           <View style={styles.expandedAuthorAvi}>
-            <UserAvatar size={35} avatar={author.avatar} />
+            <UserAvatar
+              size={35}
+              avatar={author.avatar}
+              hasWarning={!!author.labels?.length}
+            />
           </View>
           <View style={s.flex1}>
             <Text