Skip to content

Commit

Permalink
Add followed by
Browse files Browse the repository at this point in the history
  • Loading branch information
xmflsct committed May 7, 2022
1 parent 8f8b7b4 commit ed531d7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/i18n/en/screens/tabs.json
Expand Up @@ -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": {
Expand Down
13 changes: 13 additions & 0 deletions src/screens/Tabs/Shared/Account/Information/Account.tsx
@@ -1,12 +1,14 @@
import Icon from '@components/Icon'
import CustomText from '@components/Text'
import { useRelationshipQuery } from '@utils/queryHooks/relationship'
import {
getInstanceAccount,
getInstanceUri
} from '@utils/slices/instancesSlice'
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'
Expand All @@ -20,13 +22,19 @@ const AccountInformationAccount: React.FC<Props> = ({
account,
localInstance
}) => {
const { t } = useTranslation('screenTabs')
const { colors } = useTheme()
const instanceAccount = useSelector(
getInstanceAccount,
(prev, next) => prev?.acct === next?.acct
)
const instanceUri = useSelector(getInstanceUri)

const { data: relationship } = useRelationshipQuery({
id: account!.id,
options: { enabled: account !== undefined }
})

const movedContent = useMemo(() => {
if (account?.moved) {
return (
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ed531d7

Please sign in to comment.