feat: add avatar to user in frontend (#1108)

This commit is contained in:
boojack
2023-02-18 10:00:46 +08:00
committed by GitHub
parent 096a71c58b
commit bcee0bbf3a
11 changed files with 120 additions and 80 deletions

View File

@ -0,0 +1,17 @@
import { MEMOS_LOGO_URL } from "../helpers/consts";
interface Props {
avatarUrl?: string;
className?: string;
}
const UserAvatar = (props: Props) => {
const { avatarUrl, className } = props;
return (
<div className={`${className ?? ""} w-8 h-8 rounded-full bg-gray-100 dark:bg-zinc-800`}>
<img className="w-full h-full" src={avatarUrl || MEMOS_LOGO_URL} alt="" />
</div>
);
};
export default UserAvatar;