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

33 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'
2021-01-23 02:41:50 +01:00
import React, { useMemo } 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-23 02:41:50 +01:00
const AccountInformationAvatar: React.FC<Props> = ({ account }) => {
const dimension = useMemo(
() => ({
width: StyleConstants.Avatar.L,
height: StyleConstants.Avatar.L
}),
[]
)
return (
<GracefullyImage
style={styles.base}
uri={{ original: account?.avatar }}
dimension={dimension}
/>
)
}
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