use <Plural>
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import {Trans} from '@lingui/macro'
|
import {Plural} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
|
||||||
import {useFocusEffect} from '@react-navigation/native'
|
import {useFocusEffect} from '@react-navigation/native'
|
||||||
|
|
||||||
import {CommonNavigatorParams, NativeStackScreenProps} from '#/lib/routes/types'
|
import {CommonNavigatorParams, NativeStackScreenProps} from '#/lib/routes/types'
|
||||||
@@ -15,7 +14,6 @@ type Props = NativeStackScreenProps<CommonNavigatorParams, 'ProfileFollowers'>
|
|||||||
export const ProfileFollowersScreen = ({route}: Props) => {
|
export const ProfileFollowersScreen = ({route}: Props) => {
|
||||||
const {name} = route.params
|
const {name} = route.params
|
||||||
const setMinimalShellMode = useSetMinimalShellMode()
|
const setMinimalShellMode = useSetMinimalShellMode()
|
||||||
const {i18n} = useLingui()
|
|
||||||
|
|
||||||
const {data: resolvedDid} = useResolveDidQuery(name)
|
const {data: resolvedDid} = useResolveDidQuery(name)
|
||||||
const {data: profile} = useProfileQuery({
|
const {data: profile} = useProfileQuery({
|
||||||
@@ -39,9 +37,11 @@ export const ProfileFollowersScreen = ({route}: Props) => {
|
|||||||
{sanitizeDisplayName(profile.displayName || profile.handle)}
|
{sanitizeDisplayName(profile.displayName || profile.handle)}
|
||||||
</Layout.Header.TitleText>
|
</Layout.Header.TitleText>
|
||||||
<Layout.Header.SubtitleText>
|
<Layout.Header.SubtitleText>
|
||||||
<Trans>
|
<Plural
|
||||||
{i18n.number(profile.followersCount ?? 0)} followers
|
value={profile.followersCount ?? 0}
|
||||||
</Trans>
|
one="# follower"
|
||||||
|
other="# followers"
|
||||||
|
/>
|
||||||
</Layout.Header.SubtitleText>
|
</Layout.Header.SubtitleText>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import {Trans} from '@lingui/macro'
|
import {Plural} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
|
||||||
import {useFocusEffect} from '@react-navigation/native'
|
import {useFocusEffect} from '@react-navigation/native'
|
||||||
|
|
||||||
import {CommonNavigatorParams, NativeStackScreenProps} from '#/lib/routes/types'
|
import {CommonNavigatorParams, NativeStackScreenProps} from '#/lib/routes/types'
|
||||||
@@ -15,7 +14,6 @@ type Props = NativeStackScreenProps<CommonNavigatorParams, 'ProfileFollows'>
|
|||||||
export const ProfileFollowsScreen = ({route}: Props) => {
|
export const ProfileFollowsScreen = ({route}: Props) => {
|
||||||
const {name} = route.params
|
const {name} = route.params
|
||||||
const setMinimalShellMode = useSetMinimalShellMode()
|
const setMinimalShellMode = useSetMinimalShellMode()
|
||||||
const {i18n} = useLingui()
|
|
||||||
|
|
||||||
const {data: resolvedDid} = useResolveDidQuery(name)
|
const {data: resolvedDid} = useResolveDidQuery(name)
|
||||||
const {data: profile} = useProfileQuery({
|
const {data: profile} = useProfileQuery({
|
||||||
@@ -39,9 +37,11 @@ export const ProfileFollowsScreen = ({route}: Props) => {
|
|||||||
{sanitizeDisplayName(profile.displayName || profile.handle)}
|
{sanitizeDisplayName(profile.displayName || profile.handle)}
|
||||||
</Layout.Header.TitleText>
|
</Layout.Header.TitleText>
|
||||||
<Layout.Header.SubtitleText>
|
<Layout.Header.SubtitleText>
|
||||||
<Trans>
|
<Plural
|
||||||
{i18n.number(profile.followsCount ?? 0)} following
|
value={profile.followersCount ?? 0}
|
||||||
</Trans>
|
one="# following"
|
||||||
|
other="# following"
|
||||||
|
/>
|
||||||
</Layout.Header.SubtitleText>
|
</Layout.Header.SubtitleText>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user