Fix followed by text overflow

https://github.com/tooot-app/app/issues/272
This commit is contained in:
Zhiyuan Zheng 2022-05-29 17:28:27 +02:00
parent 6b4c2d18ec
commit c94ef1882b
2 changed files with 23 additions and 39 deletions

View File

@ -14,11 +14,11 @@ name: "CodeQL"
on:
push:
branches: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
- cron: '35 4 * * 4'
# pull_request:
# # The branches below must be a subset of the branches above
# branches: [ main ]
# schedule:
# - cron: '35 4 * * 4'
jobs:
analyze:

View File

@ -7,7 +7,7 @@ import {
} from '@utils/slices/instancesSlice'
import { StyleConstants } from '@utils/styles/constants'
import { useTheme } from '@utils/styles/ThemeManager'
import React, { useMemo } from 'react'
import React from 'react'
import { useTranslation } from 'react-i18next'
import { View } from 'react-native'
import { useSelector } from 'react-redux'
@ -35,23 +35,6 @@ const AccountInformationAccount: React.FC<Props> = ({
options: { enabled: account !== undefined }
})
const movedContent = useMemo(() => {
if (account?.moved) {
return (
<CustomText
fontStyle='M'
style={{
marginLeft: StyleConstants.Spacing.S,
color: colors.secondary
}}
selectable
>
@{account.moved.acct}
</CustomText>
)
}
}, [account?.moved])
if (account || (localInstance && instanceAccount)) {
return (
<View
@ -62,23 +45,24 @@ const AccountInformationAccount: React.FC<Props> = ({
marginBottom: StyleConstants.Spacing.L
}}
>
<CustomText
fontStyle='M'
style={{
textDecorationLine: account?.moved ? 'line-through' : undefined,
color: colors.secondary
}}
selectable
>
@{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 fontStyle='M' style={{ color: colors.secondary }}>
{account?.moved ? (
<>
{' '}
<CustomText selectable>@{account.moved.acct}</CustomText>
</>
) : null}
<CustomText
style={{
textDecorationLine: account?.moved ? 'line-through' : undefined
}}
selectable
>
@{localInstance ? instanceAccount?.acct : account?.acct}
{localInstance ? `@${instanceUri}` : null}
</CustomText>
) : null}
{movedContent}
{relationship?.followed_by ? t('shared.account.followed_by') : null}
</CustomText>
{account?.locked ? (
<Icon
name='Lock'