Add custom feed liked by screen
parent
998879d6d6
commit
a2c89b47a1
|
@ -40,7 +40,8 @@ import {SettingsScreen} from './view/screens/Settings'
|
||||||
import {ProfileScreen} from './view/screens/Profile'
|
import {ProfileScreen} from './view/screens/Profile'
|
||||||
import {ProfileFollowersScreen} from './view/screens/ProfileFollowers'
|
import {ProfileFollowersScreen} from './view/screens/ProfileFollowers'
|
||||||
import {ProfileFollowsScreen} from './view/screens/ProfileFollows'
|
import {ProfileFollowsScreen} from './view/screens/ProfileFollows'
|
||||||
import {ProfileCustomFeed} from './view/screens/ProfileCustomFeed'
|
import {CustomFeedScreen} from './view/screens/CustomFeed'
|
||||||
|
import {CustomFeedLikedByScreen} from './view/screens/CustomFeedLikedBy'
|
||||||
import {ProfileListScreen} from './view/screens/ProfileList'
|
import {ProfileListScreen} from './view/screens/ProfileList'
|
||||||
import {PostThreadScreen} from './view/screens/PostThread'
|
import {PostThreadScreen} from './view/screens/PostThread'
|
||||||
import {PostLikedByScreen} from './view/screens/PostLikedBy'
|
import {PostLikedByScreen} from './view/screens/PostLikedBy'
|
||||||
|
@ -126,7 +127,6 @@ function commonScreens(Stack: typeof HomeTab, unreadCountLabel?: string) {
|
||||||
title: title(`People followed by @${route.params.name}`),
|
title: title(`People followed by @${route.params.name}`),
|
||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen name="ProfileCustomFeed" component={ProfileCustomFeed} />
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="ProfileList"
|
name="ProfileList"
|
||||||
component={ProfileListScreen}
|
component={ProfileListScreen}
|
||||||
|
@ -147,6 +147,11 @@ function commonScreens(Stack: typeof HomeTab, unreadCountLabel?: string) {
|
||||||
component={PostRepostedByScreen}
|
component={PostRepostedByScreen}
|
||||||
options={({route}) => ({title: title(`Post by @${route.params.name}`)})}
|
options={({route}) => ({title: title(`Post by @${route.params.name}`)})}
|
||||||
/>
|
/>
|
||||||
|
<Stack.Screen name="CustomFeed" component={CustomFeedScreen} />
|
||||||
|
<Stack.Screen
|
||||||
|
name="CustomFeedLikedBy"
|
||||||
|
component={CustomFeedLikedByScreen}
|
||||||
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="Debug"
|
name="Debug"
|
||||||
component={DebugScreen}
|
component={DebugScreen}
|
||||||
|
|
|
@ -13,11 +13,12 @@ export type CommonNavigatorParams = {
|
||||||
Profile: {name: string; hideBackButton?: boolean}
|
Profile: {name: string; hideBackButton?: boolean}
|
||||||
ProfileFollowers: {name: string}
|
ProfileFollowers: {name: string}
|
||||||
ProfileFollows: {name: string}
|
ProfileFollows: {name: string}
|
||||||
ProfileCustomFeed: {name: string; rkey: string}
|
|
||||||
ProfileList: {name: string; rkey: string}
|
ProfileList: {name: string; rkey: string}
|
||||||
PostThread: {name: string; rkey: string}
|
PostThread: {name: string; rkey: string}
|
||||||
PostLikedBy: {name: string; rkey: string}
|
PostLikedBy: {name: string; rkey: string}
|
||||||
PostRepostedBy: {name: string; rkey: string}
|
PostRepostedBy: {name: string; rkey: string}
|
||||||
|
CustomFeed: {name: string; rkey: string}
|
||||||
|
CustomFeedLikedBy: {name: string; rkey: string}
|
||||||
Debug: undefined
|
Debug: undefined
|
||||||
Log: undefined
|
Log: undefined
|
||||||
Support: undefined
|
Support: undefined
|
||||||
|
|
|
@ -17,6 +17,7 @@ export const router = new Router({
|
||||||
PostLikedBy: '/profile/:name/post/:rkey/liked-by',
|
PostLikedBy: '/profile/:name/post/:rkey/liked-by',
|
||||||
PostRepostedBy: '/profile/:name/post/:rkey/reposted-by',
|
PostRepostedBy: '/profile/:name/post/:rkey/reposted-by',
|
||||||
CustomFeed: '/profile/:name/feed/:rkey',
|
CustomFeed: '/profile/:name/feed/:rkey',
|
||||||
|
CustomFeedLikedBy: '/profile/:name/feed/:rkey/liked-by',
|
||||||
Debug: '/sys/debug',
|
Debug: '/sys/debug',
|
||||||
Log: '/sys/log',
|
Log: '/sys/log',
|
||||||
AppPasswords: '/settings/app-passwords',
|
AppPasswords: '/settings/app-passwords',
|
||||||
|
|
|
@ -61,7 +61,7 @@ export const CustomFeed = observer(
|
||||||
accessibilityRole="button"
|
accessibilityRole="button"
|
||||||
style={[styles.container, pal.border, style]}
|
style={[styles.container, pal.border, style]}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
navigation.navigate('ProfileCustomFeed', {
|
navigation.navigate('CustomFeed', {
|
||||||
name: item.data.creator.did,
|
name: item.data.creator.did,
|
||||||
rkey: new AtUri(item.data.uri).rkey,
|
rkey: new AtUri(item.data.uri).rkey,
|
||||||
})
|
})
|
||||||
|
|
|
@ -21,8 +21,8 @@ import {Text} from 'view/com/util/text/Text'
|
||||||
import * as Toast from 'view/com/util/Toast'
|
import * as Toast from 'view/com/util/Toast'
|
||||||
import {isDesktopWeb} from 'platform/detection'
|
import {isDesktopWeb} from 'platform/detection'
|
||||||
|
|
||||||
type Props = NativeStackScreenProps<CommonNavigatorParams, 'ProfileCustomFeed'>
|
type Props = NativeStackScreenProps<CommonNavigatorParams, 'CustomFeed'>
|
||||||
export const ProfileCustomFeed = withAuthRequired(
|
export const CustomFeedScreen = withAuthRequired(
|
||||||
observer(({route}: Props) => {
|
observer(({route}: Props) => {
|
||||||
const store = useStores()
|
const store = useStores()
|
||||||
const pal = usePalette('default')
|
const pal = usePalette('default')
|
||||||
|
@ -146,10 +146,15 @@ export const ProfileCustomFeed = withAuthRequired(
|
||||||
{currentFeed.data.description}
|
{currentFeed.data.description}
|
||||||
</Text>
|
</Text>
|
||||||
) : null}
|
) : null}
|
||||||
<Text type="md-medium" style={pal.textLight}>
|
<TextLink
|
||||||
Liked by {currentFeed?.data.likeCount}{' '}
|
type="md-medium"
|
||||||
{pluralize(currentFeed?.data.likeCount || 0, 'user')}
|
style={pal.textLight}
|
||||||
</Text>
|
href={`/profile/${name}/feed/${rkey}/liked-by`}
|
||||||
|
text={`Liked by ${currentFeed?.data.likeCount} ${pluralize(
|
||||||
|
currentFeed?.data.likeCount || 0,
|
||||||
|
'user',
|
||||||
|
)}`}
|
||||||
|
/>
|
||||||
{isDesktopWeb && (
|
{isDesktopWeb && (
|
||||||
<View style={styles.headerBtns}>
|
<View style={styles.headerBtns}>
|
||||||
<Button
|
<Button
|
||||||
|
@ -198,30 +203,6 @@ export const ProfileCustomFeed = withAuthRequired(
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
<View style={[styles.headerContainer]}>
|
|
||||||
<View style={[styles.header]}>
|
|
||||||
<View style={styles.avatarContainer}>
|
|
||||||
<UserAvatar
|
|
||||||
type="algo"
|
|
||||||
size={28}
|
|
||||||
avatar={currentFeed?.data.avatar}
|
|
||||||
/>
|
|
||||||
<Link href={`/profile/${currentFeed?.data.creator.handle}`}>
|
|
||||||
<Text style={[pal.textLight]}>
|
|
||||||
@{currentFeed?.data.creator.handle}
|
|
||||||
</Text>
|
|
||||||
</Link>
|
|
||||||
</View>
|
|
||||||
<Text style={[pal.text]}>{currentFeed?.data.description}</Text>
|
|
||||||
</View>
|
|
||||||
|
|
||||||
<View style={[styles.buttonsContainer]}>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
*/
|
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
headerBtns: {
|
headerBtns: {
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
|
@ -251,43 +232,4 @@ const styles = StyleSheet.create({
|
||||||
liked: {
|
liked: {
|
||||||
color: colors.red3,
|
color: colors.red3,
|
||||||
},
|
},
|
||||||
|
|
||||||
/* headerContainer: {
|
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'center',
|
|
||||||
gap: 8,
|
|
||||||
marginBottom: 12,
|
|
||||||
},
|
|
||||||
header: {
|
|
||||||
alignItems: 'center',
|
|
||||||
gap: 4,
|
|
||||||
},
|
|
||||||
avatarContainer: {
|
|
||||||
flexDirection: 'row',
|
|
||||||
alignItems: 'center',
|
|
||||||
gap: 8,
|
|
||||||
},
|
|
||||||
buttonsContainer: {
|
|
||||||
flexDirection: 'row',
|
|
||||||
gap: 8,
|
|
||||||
},
|
|
||||||
saveButton: {
|
|
||||||
minWidth: 100,
|
|
||||||
alignItems: 'center',
|
|
||||||
},
|
|
||||||
liked: {
|
|
||||||
color: colors.red3,
|
|
||||||
},
|
|
||||||
notLiked: {
|
|
||||||
color: colors.gray3,
|
|
||||||
},
|
|
||||||
likeButton: {
|
|
||||||
flexDirection: 'row',
|
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'center',
|
|
||||||
paddingVertical: 4,
|
|
||||||
paddingHorizontal: 8,
|
|
||||||
borderRadius: 24,
|
|
||||||
gap: 4,
|
|
||||||
},*/
|
|
||||||
})
|
})
|
|
@ -0,0 +1,29 @@
|
||||||
|
import React from 'react'
|
||||||
|
import {View} from 'react-native'
|
||||||
|
import {useFocusEffect} from '@react-navigation/native'
|
||||||
|
import {NativeStackScreenProps, CommonNavigatorParams} from 'lib/routes/types'
|
||||||
|
import {withAuthRequired} from 'view/com/auth/withAuthRequired'
|
||||||
|
import {ViewHeader} from '../com/util/ViewHeader'
|
||||||
|
import {PostLikedBy as PostLikedByComponent} from '../com/post-thread/PostLikedBy'
|
||||||
|
import {useStores} from 'state/index'
|
||||||
|
import {makeRecordUri} from 'lib/strings/url-helpers'
|
||||||
|
|
||||||
|
type Props = NativeStackScreenProps<CommonNavigatorParams, 'CustomFeedLikedBy'>
|
||||||
|
export const CustomFeedLikedByScreen = withAuthRequired(({route}: Props) => {
|
||||||
|
const store = useStores()
|
||||||
|
const {name, rkey} = route.params
|
||||||
|
const uri = makeRecordUri(name, 'app.bsky.feed.generator', rkey)
|
||||||
|
|
||||||
|
useFocusEffect(
|
||||||
|
React.useCallback(() => {
|
||||||
|
store.shell.setMinimalShellMode(false)
|
||||||
|
}, [store]),
|
||||||
|
)
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View>
|
||||||
|
<ViewHeader title="Liked by" />
|
||||||
|
<PostLikedByComponent uri={uri} />
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
})
|
Loading…
Reference in New Issue