2021-05-09 21:59:03 +02:00
|
|
|
import { ParseHTML } from '@components/Parse'
|
|
|
|
import { StyleConstants } from '@utils/styles/constants'
|
|
|
|
import React, { useState } from 'react'
|
|
|
|
import { StyleSheet, View } from 'react-native'
|
|
|
|
|
|
|
|
export interface Props {
|
|
|
|
account: Mastodon.Account | undefined
|
|
|
|
myInfo?: boolean
|
|
|
|
}
|
|
|
|
|
|
|
|
const AccountInformationNote = React.memo(
|
2022-09-18 01:02:25 +02:00
|
|
|
({ account, myInfo }: Props) => {
|
2021-05-09 21:59:03 +02:00
|
|
|
const [note, setNote] = useState(account?.source?.note)
|
|
|
|
if (
|
2022-11-06 23:39:31 +01:00
|
|
|
account?.suspended ||
|
2021-05-09 21:59:03 +02:00
|
|
|
myInfo ||
|
|
|
|
!account?.note ||
|
|
|
|
account.note.length === 0 ||
|
|
|
|
account.note === '<p></p>'
|
|
|
|
) {
|
|
|
|
return null
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<View style={styles.note}>
|
2022-12-05 18:56:38 +01:00
|
|
|
<ParseHTML
|
|
|
|
content={account.note!}
|
|
|
|
size={'M'}
|
|
|
|
emojis={account.emojis}
|
|
|
|
selectable
|
|
|
|
numberOfLines={999}
|
|
|
|
/>
|
2021-05-09 21:59:03 +02:00
|
|
|
</View>
|
|
|
|
)
|
|
|
|
},
|
2021-05-17 22:32:35 +02:00
|
|
|
(_, next) => next.account === undefined
|
2021-05-09 21:59:03 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
note: {
|
|
|
|
marginBottom: StyleConstants.Spacing.L
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
export default AccountInformationNote
|