tooot/src/screens/Tabs/Shared/Account/Information/Note.tsx

36 lines
774 B
TypeScript
Raw Normal View History

2021-05-09 21:59:03 +02:00
import { ParseHTML } from '@components/Parse'
import { StyleConstants } from '@utils/styles/constants'
2022-12-12 20:43:45 +01:00
import React from 'react'
import { View } from 'react-native'
2021-05-09 21:59:03 +02:00
export interface Props {
account: Mastodon.Account | undefined
myInfo?: boolean
}
2022-12-12 20:43:45 +01:00
const AccountInformationNote: React.FC<Props> = ({ account, myInfo }) => {
if (
account?.suspended ||
myInfo ||
!account?.note ||
account.note.length === 0 ||
account.note === '<p></p>'
) {
return null
2021-05-09 21:59:03 +02:00
}
2022-12-12 20:43:45 +01:00
return (
<View style={{ marginBottom: StyleConstants.Spacing.L }}>
<ParseHTML
content={account.note!}
size={'M'}
emojis={account.emojis}
selectable
numberOfLines={999}
/>
</View>
)
}
2021-05-09 21:59:03 +02:00
export default AccountInformationNote