mirror of
https://github.com/vercel/commerce.git
synced 2025-07-29 21:21:23 +00:00
.vscode
assets
components
auth
cart
checkout
common
Avatar
Avatar.tsx
index.ts
FeatureBar
Footer
Head
HomeAllProductsGrid
I18nWidget
Layout
Navbar
Searchbar
SidebarLayout
UserNav
index.ts
icons
product
ui
wishlist
config
framework
lib
pages
public
.editorconfig
.env.template
.gitignore
.prettierignore
.prettierrc
README.md
codegen.json
commerce.config.json
global.d.ts
license.md
next-env.d.ts
next.config.js
package.json
postcss.config.js
tailwind.config.js
tsconfig.json
yarn.lock
25 lines
669 B
TypeScript
25 lines
669 B
TypeScript
import { FC, useRef, useEffect } from 'react'
|
|
import { useUserAvatar } from '@lib/hooks/useUserAvatar'
|
|
|
|
interface Props {
|
|
className?: string
|
|
children?: any
|
|
}
|
|
|
|
const Avatar: FC<Props> = ({}) => {
|
|
let ref = useRef() as React.MutableRefObject<HTMLInputElement>
|
|
let { userAvatar } = useUserAvatar()
|
|
|
|
return (
|
|
<div
|
|
ref={ref}
|
|
style={{ backgroundImage: userAvatar }}
|
|
className="inline-block h-8 w-8 rounded-full border-2 border-primary hover:border-secondary focus:border-secondary transition-colors ease-linear"
|
|
>
|
|
{/* Add an image - We're generating a gradient as placeholder <img></img> */}
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default Avatar
|