diff options
Diffstat (limited to 'src/view/screens')
-rw-r--r-- | src/view/screens/PostDownvotedBy.tsx | 26 | ||||
-rw-r--r-- | src/view/screens/PostUpvotedBy.tsx (renamed from src/view/screens/PostLikedBy.tsx) | 10 |
2 files changed, 31 insertions, 5 deletions
diff --git a/src/view/screens/PostDownvotedBy.tsx b/src/view/screens/PostDownvotedBy.tsx new file mode 100644 index 000000000..a77476834 --- /dev/null +++ b/src/view/screens/PostDownvotedBy.tsx @@ -0,0 +1,26 @@ +import React, {useEffect} from 'react' +import {View} from 'react-native' +import {ViewHeader} from '../com/util/ViewHeader' +import {PostVotedBy as PostLikedByComponent} from '../com/post-thread/PostVotedBy' +import {ScreenParams} from '../routes' +import {useStores} from '../../state' +import {makeRecordUri} from '../lib/strings' + +export const PostDownvotedBy = ({visible, params}: ScreenParams) => { + const store = useStores() + const {name, rkey} = params + const uri = makeRecordUri(name, 'app.bsky.feed.post', rkey) + + useEffect(() => { + if (visible) { + store.nav.setTitle('Downvoted by') + } + }, [store, visible]) + + return ( + <View> + <ViewHeader title="Downvoted by" /> + <PostLikedByComponent uri={uri} direction="down" /> + </View> + ) +} diff --git a/src/view/screens/PostLikedBy.tsx b/src/view/screens/PostUpvotedBy.tsx index 8adc58c89..0bf662def 100644 --- a/src/view/screens/PostLikedBy.tsx +++ b/src/view/screens/PostUpvotedBy.tsx @@ -1,26 +1,26 @@ import React, {useEffect} from 'react' import {View} from 'react-native' import {ViewHeader} from '../com/util/ViewHeader' -import {PostLikedBy as PostLikedByComponent} from '../com/post-thread/PostLikedBy' +import {PostVotedBy as PostLikedByComponent} from '../com/post-thread/PostVotedBy' import {ScreenParams} from '../routes' import {useStores} from '../../state' import {makeRecordUri} from '../lib/strings' -export const PostLikedBy = ({visible, params}: ScreenParams) => { +export const PostUpvotedBy = ({visible, params}: ScreenParams) => { const store = useStores() const {name, rkey} = params const uri = makeRecordUri(name, 'app.bsky.feed.post', rkey) useEffect(() => { if (visible) { - store.nav.setTitle('Liked by') + store.nav.setTitle('Upvoted by') } }, [store, visible]) return ( <View> - <ViewHeader title="Liked by" /> - <PostLikedByComponent uri={uri} /> + <ViewHeader title="Upvoted by" /> + <PostLikedByComponent uri={uri} direction="up" /> </View> ) } |