diff options
Diffstat (limited to 'src/view/com/notifications')
-rw-r--r-- | src/view/com/notifications/Feed.tsx | 14 | ||||
-rw-r--r-- | src/view/com/notifications/FeedItem.tsx | 18 |
2 files changed, 19 insertions, 13 deletions
diff --git a/src/view/com/notifications/Feed.tsx b/src/view/com/notifications/Feed.tsx index 52d534c4f..a99fe2c1d 100644 --- a/src/view/com/notifications/Feed.tsx +++ b/src/view/com/notifications/Feed.tsx @@ -1,13 +1,12 @@ import React from 'react' import {CenteredView} from '../util/Views' -import {ActivityIndicator, RefreshControl, StyleSheet, View} from 'react-native' +import {ActivityIndicator, StyleSheet, View} from 'react-native' import {FeedItem} from './FeedItem' import {NotificationFeedLoadingPlaceholder} from '../util/LoadingPlaceholder' import {ErrorMessage} from '../util/error/ErrorMessage' import {LoadMoreRetryBtn} from '../util/LoadMoreRetryBtn' import {EmptyState} from '../util/EmptyState' import {s} from 'lib/styles' -import {usePalette} from 'lib/hooks/usePalette' import {useNotificationFeedQuery} from '#/state/queries/notifications/feed' import {useUnreadNotificationsApi} from '#/state/queries/notifications/unread' import {logger} from '#/logger' @@ -30,7 +29,6 @@ export function Feed({ onScrolledDownChange: (isScrolledDown: boolean) => void ListHeaderComponent?: () => JSX.Element }) { - const pal = usePalette('default') const [isPTRing, setIsPTRing] = React.useState(false) const moderationOpts = useModerationOpts() @@ -152,14 +150,8 @@ export function Feed({ renderItem={renderItem} ListHeaderComponent={ListHeaderComponent} ListFooterComponent={FeedFooter} - refreshControl={ - <RefreshControl - refreshing={isPTRing} - onRefresh={onRefresh} - tintColor={pal.colors.text} - titleColor={pal.colors.text} - /> - } + refreshing={isPTRing} + onRefresh={onRefresh} onEndReached={onEndReached} onEndReachedThreshold={0.6} onScrolledDownChange={onScrolledDownChange} diff --git a/src/view/com/notifications/FeedItem.tsx b/src/view/com/notifications/FeedItem.tsx index aaa2ea2c6..24b7e4fb6 100644 --- a/src/view/com/notifications/FeedItem.tsx +++ b/src/view/com/notifications/FeedItem.tsx @@ -42,6 +42,7 @@ import {TimeElapsed} from '../util/TimeElapsed' import {isWeb} from 'platform/detection' import {Trans, msg} from '@lingui/macro' import {useLingui} from '@lingui/react' +import {FeedSourceCard} from '../feeds/FeedSourceCard' const MAX_AUTHORS = 5 @@ -112,7 +113,7 @@ let FeedItem = ({ ] }, [item, moderationOpts]) - if (item.subjectUri && !item.subject) { + if (item.subjectUri && !item.subject && item.type !== 'feedgen-like') { // don't render anything if the target post was deleted or unfindable return <View /> } @@ -166,7 +167,7 @@ let FeedItem = ({ iconStyle = [s.blue3 as FontAwesomeIconStyle] } else if (item.type === 'feedgen-like') { action = `liked your custom feed${ - item.subjectUri ? ` '${new AtUri(item.subjectUri).rkey}}'` : '' + item.subjectUri ? ` '${new AtUri(item.subjectUri).rkey}'` : '' }` icon = 'HeartIconSolid' iconStyle = [ @@ -256,6 +257,13 @@ let FeedItem = ({ {item.type === 'post-like' || item.type === 'repost' ? ( <AdditionalPostText post={item.subject} /> ) : null} + {item.type === 'feedgen-like' && item.subjectUri ? ( + <FeedSourceCard + feedUri={item.subjectUri} + style={[pal.view, pal.border, styles.feedcard]} + showLikes + /> + ) : null} </View> </Link> ) @@ -496,6 +504,12 @@ const styles = StyleSheet.create({ marginLeft: 2, opacity: 0.8, }, + feedcard: { + borderWidth: 1, + borderRadius: 8, + paddingVertical: 12, + marginTop: 6, + }, addedContainer: { paddingTop: 4, |