diff --git a/src/screens/Post/PostQuotes.tsx b/src/screens/Post/PostQuotes.tsx index 2cd6be8793..24e942abf1 100644 --- a/src/screens/Post/PostQuotes.tsx +++ b/src/screens/Post/PostQuotes.tsx @@ -1,15 +1,12 @@ import React from 'react' -import {msg} from '@lingui/macro' -import {useLingui} from '@lingui/react' +import {Plural, Trans} from '@lingui/macro' import {useFocusEffect} from '@react-navigation/native' import {CommonNavigatorParams, NativeStackScreenProps} from '#/lib/routes/types' import {makeRecordUri} from '#/lib/strings/url-helpers' -import {isWeb} from '#/platform/detection' +import {usePostThreadQuery} from '#/state/queries/post-thread' import {useSetMinimalShellMode} from '#/state/shell' import {PostQuotes as PostQuotesComponent} from '#/view/com/post-thread/PostQuotes' -import {ViewHeader} from '#/view/com/util/ViewHeader' -import {CenteredView} from '#/view/com/util/Views' import * as Layout from '#/components/Layout' type Props = NativeStackScreenProps @@ -17,7 +14,12 @@ export const PostQuotesScreen = ({route}: Props) => { const setMinimalShellMode = useSetMinimalShellMode() const {name, rkey} = route.params const uri = makeRecordUri(name, 'app.bsky.feed.post', rkey) - const {_} = useLingui() + const {data: post} = usePostThreadQuery(uri) + + let quoteCount + if (post?.thread.type === 'post') { + quoteCount = post.thread.post.quoteCount + } useFocusEffect( React.useCallback(() => { @@ -27,10 +29,27 @@ export const PostQuotesScreen = ({route}: Props) => { return ( - - - - + + + + {post && ( + <> + + Quotes + + + + + + )} + + + + ) } diff --git a/src/screens/Post/PostRepostedBy.tsx b/src/screens/Post/PostRepostedBy.tsx index 304e708081..28cd7e87c3 100644 --- a/src/screens/Post/PostRepostedBy.tsx +++ b/src/screens/Post/PostRepostedBy.tsx @@ -1,15 +1,12 @@ import React from 'react' -import {msg} from '@lingui/macro' -import {useLingui} from '@lingui/react' +import {Plural, Trans} from '@lingui/macro' import {useFocusEffect} from '@react-navigation/native' import {CommonNavigatorParams, NativeStackScreenProps} from '#/lib/routes/types' import {makeRecordUri} from '#/lib/strings/url-helpers' -import {isWeb} from '#/platform/detection' +import {usePostThreadQuery} from '#/state/queries/post-thread' import {useSetMinimalShellMode} from '#/state/shell' import {PostRepostedBy as PostRepostedByComponent} from '#/view/com/post-thread/PostRepostedBy' -import {ViewHeader} from '#/view/com/util/ViewHeader' -import {CenteredView} from '#/view/com/util/Views' import * as Layout from '#/components/Layout' type Props = NativeStackScreenProps @@ -17,7 +14,12 @@ export const PostRepostedByScreen = ({route}: Props) => { const {name, rkey} = route.params const uri = makeRecordUri(name, 'app.bsky.feed.post', rkey) const setMinimalShellMode = useSetMinimalShellMode() - const {_} = useLingui() + const {data: post} = usePostThreadQuery(uri) + + let quoteCount + if (post?.thread.type === 'post') { + quoteCount = post.thread.post.repostCount + } useFocusEffect( React.useCallback(() => { @@ -27,10 +29,27 @@ export const PostRepostedByScreen = ({route}: Props) => { return ( - - - - + + + + {post && ( + <> + + Reposted By + + + + + + )} + + + + ) }