feat: add avatar component

This commit is contained in:
Daniel Soares
2021-12-11 12:53:26 -03:00
parent 438be66699
commit 54cab65e79
4 changed files with 35 additions and 7 deletions

View File

@@ -0,0 +1,11 @@
import { ImageProps } from 'next/image'
import { Wrapper } from './styles'
type AvatarProps = ImageProps & {
src?: string
}
export function Avatar({ src, ...rest }: AvatarProps) {
return !!src ? <Wrapper src={src} width={84} height={84} quality={100} {...rest} /> : null
}

View File

@@ -0,0 +1,10 @@
import Image from 'next/image'
import { styled } from '../../styles/stitches.config'
export const Wrapper = styled(Image, {
borderRadius: '9999px',
objectFit: 'cover',
width: '84px',
height: '84px'
})