Add followed by

https://github.com/tooot-app/app/issues/272
This commit is contained in:
Zhiyuan Zheng 2022-05-08 00:24:15 +02:00
parent 8f8b7b41b9
commit ed531d7371
2 changed files with 14 additions and 0 deletions

View File

@ -281,6 +281,7 @@
"accessibilityLabel": "Actions for user {{user}}",
"accessibilityHint": "You can mute, block, report or share this user"
},
"followed_by": " is following you",
"moved": "User moved",
"created_at": "Registered on: {{date}}",
"summary": {

View File

@ -1,5 +1,6 @@
import Icon from '@components/Icon'
import CustomText from '@components/Text'
import { useRelationshipQuery } from '@utils/queryHooks/relationship'
import {
getInstanceAccount,
getInstanceUri
@ -7,6 +8,7 @@ import {
import { StyleConstants } from '@utils/styles/constants'
import { useTheme } from '@utils/styles/ThemeManager'
import React, { useMemo } from 'react'
import { useTranslation } from 'react-i18next'
import { View } from 'react-native'
import { useSelector } from 'react-redux'
import { PlaceholderLine } from 'rn-placeholder'
@ -20,6 +22,7 @@ const AccountInformationAccount: React.FC<Props> = ({
account,
localInstance
}) => {
const { t } = useTranslation('screenTabs')
const { colors } = useTheme()
const instanceAccount = useSelector(
getInstanceAccount,
@ -27,6 +30,11 @@ const AccountInformationAccount: React.FC<Props> = ({
)
const instanceUri = useSelector(getInstanceUri)
const { data: relationship } = useRelationshipQuery({
id: account!.id,
options: { enabled: account !== undefined }
})
const movedContent = useMemo(() => {
if (account?.moved) {
return (
@ -65,6 +73,11 @@ const AccountInformationAccount: React.FC<Props> = ({
@{localInstance ? instanceAccount?.acct : account?.acct}
{localInstance ? `@${instanceUri}` : null}
</CustomText>
{relationship?.followed_by ? (
<CustomText fontStyle='M' style={{ color: colors.secondary }}>
{t('shared.account.followed_by')}
</CustomText>
) : null}
{movedContent}
{account?.locked ? (
<Icon