tooot/src/screens/Shared/Account/Information/Avatar.tsx

26 lines
640 B
TypeScript
Raw Normal View History

2021-01-16 00:00:31 +01:00
import GracefullyImage from '@components/GracefullyImage'
import { StyleConstants } from '@utils/styles/constants'
import React from 'react'
2020-12-27 16:25:29 +01:00
export interface Props {
account: Mastodon.Account | undefined
}
2021-01-16 00:00:31 +01:00
const AccountInformationAvatar = React.memo(
({ account }: Props) => {
2020-12-27 16:25:29 +01:00
return (
2021-01-16 00:00:31 +01:00
<GracefullyImage
uri={{ original: account?.avatar }}
dimension={{
width: StyleConstants.Avatar.L,
height: StyleConstants.Avatar.L
}}
style={{ borderRadius: 8, overflow: 'hidden' }}
/>
2020-12-27 16:25:29 +01:00
)
2021-01-16 00:00:31 +01:00
},
(_, next) => next.account === undefined
2020-12-27 16:25:29 +01:00
)
export default AccountInformationAvatar