From 24ad2f3c065bd1836519cfe65eed27527c877083 Mon Sep 17 00:00:00 2001 From: Matt Kirby <MattJKirby@outlook.com> Date: Mon, 17 Apr 2023 02:06:28 +0100 Subject: [PATCH] Added useravatar --- .../src/components/user/UserAvatar.tsx | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 daily-thought-frontend/src/components/user/UserAvatar.tsx diff --git a/daily-thought-frontend/src/components/user/UserAvatar.tsx b/daily-thought-frontend/src/components/user/UserAvatar.tsx new file mode 100644 index 00000000..5abc1386 --- /dev/null +++ b/daily-thought-frontend/src/components/user/UserAvatar.tsx @@ -0,0 +1,30 @@ +import { UserCircleIcon, UserPlusIcon } from "@heroicons/react/24/outline"; +import { FC, PropsWithChildren } from "react"; + +type UserAvatarProps = { + firstName?: string, + lastName?: string, + profile?:string, + username: string +} + +const UserAvatar:FC<PropsWithChildren<UserAvatarProps>> = ({ + username, + firstName, + lastName, + +}) => { + return ( + <div className='flex items-center p-1'> + <div className=""> + <UserCircleIcon className='h-12 w-12 rounded-full text-gray-300 flex items-center justify-center' /> + </div> + <div className='text-sm ml-1 text-gray-900 whitespace-nowrap'> + {firstName && <div>{`${firstName} ${lastName || null}`}</div>} + <p className='text-sm text-gray-500 font-normal'>@{username}</p> + </div> + </div> + ) +} + +export default UserAvatar; \ No newline at end of file -- GitLab