Zhiyuan Zheng 2020-12-29 12:36:21 +01:00
parent 8e93492ae3
commit b92a01e2a4
No known key found for this signature in database
GPG Key ID: 078A93AB607D85E0
4 changed files with 17 additions and 13 deletions

View File

@ -60,21 +60,25 @@ const AccountInformation: React.FC<Props> = ({
{/* <Text>Moved or not: {account.moved}</Text> */}
<View style={styles.avatarAndActions}>
<AccountInformationAvatar ref={shimmerAvatarRef} account={account} />
{!disableActions && <AccountInformationActions account={account} />}
{!disableActions ? (
<AccountInformationActions account={account} />
) : null}
</View>
<AccountInformationName ref={shimmerNameRef} account={account} />
<AccountInformationAccount ref={shimmerAccountRef} account={account} />
{account?.fields && account.fields.length > 0 && (
{account?.fields && account.fields.length > 0 ? (
<AccountInformationFields account={account} />
)}
) : null}
{account?.note && account.note.length > 0 && account.note !== '<p></p>' && (
{account?.note &&
account.note.length > 0 &&
account.note !== '<p></p>' ? (
// Empty notes might generate empty p tag
<AccountInformationNotes account={account} />
)}
) : null}
<AccountInformationCreated ref={shimmerCreatedRef} account={account} />

View File

@ -37,16 +37,16 @@ const AccountInformationAccount = forwardRef<ShimmerPlaceholder, Props>(
>
@{account?.acct}
</Text>
{account?.locked && (
{account?.locked ? (
<Feather name='lock' style={styles.type} color={theme.secondary} />
)}
{account?.bot && (
) : null}
{account?.bot ? (
<Feather
name='hard-drive'
style={styles.type}
color={theme.secondary}
/>
)}
) : null}
</View>
</ShimmerPlaceholder>
)

View File

@ -124,7 +124,7 @@ const AccountInformationActions: React.FC<Props> = ({ account }) => {
return (
<View style={styles.actions}>
{query.data && !query.data.blocked_by && (
{query.data && !query.data.blocked_by ? (
<Button
type='icon'
content='mail'
@ -140,7 +140,7 @@ const AccountInformationActions: React.FC<Props> = ({ account }) => {
}
style={styles.actionConversation}
/>
)}
) : null}
{mainAction}
</View>
)

View File

@ -26,14 +26,14 @@ const AccountInformationFields: React.FC<Props> = ({ account }) => {
emojis={account.emojis}
showFullLink
/>
{field.verified_at && (
{field.verified_at ? (
<Feather
name='check-circle'
size={StyleConstants.Font.Size.M}
color={theme.primary}
style={styles.fieldCheck}
/>
)}
) : null}
</View>
<View style={styles.fieldRight}>
<ParseContent