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: on:
push: push:
branches: [ main ] branches: [ main ]
pull_request: # pull_request:
# The branches below must be a subset of the branches above # # The branches below must be a subset of the branches above
branches: [ main ] # branches: [ main ]
schedule: # schedule:
- cron: '35 4 * * 4' # - cron: '35 4 * * 4'
jobs: jobs:
analyze: analyze:

View File

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