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

31 lines
741 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'
2021-01-20 12:35:24 +01:00
import { StyleSheet } from 'react-native'
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
2021-01-20 12:35:24 +01:00
style={styles.base}
2021-01-16 00:00:31 +01:00
uri={{ original: account?.avatar }}
dimension={{
width: StyleConstants.Avatar.L,
height: StyleConstants.Avatar.L
}}
/>
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
)
2021-01-20 12:35:24 +01:00
const styles = StyleSheet.create({
base: { borderRadius: 8, overflow: 'hidden' }
})
2020-12-27 16:25:29 +01:00
export default AccountInformationAvatar