feat: enhance navbar and news detail page with improved profile picture handling

This commit is contained in:
Ardeman
2025-03-08 15:23:22 +08:00
parent 609866beef
commit 4b61fd9501
2 changed files with 28 additions and 19 deletions
+6 -6
View File
@@ -25,16 +25,16 @@ export const Navbar = () => {
</Link>
<div className="flex items-center gap-x-8">
<Popover className="relative">
<PopoverButton className="flex w-3xs cursor-pointer items-center justify-between focus:outline-none">
<div className="flex items-center">
{staffData?.profile_picture === '' ? (
<ProfileIcon className="mr-3 h-8 w-8 rounded-full bg-[#C4C4C4]" />
) : (
<PopoverButton className="flex w-3xs cursor-pointer items-center justify-between rounded-xl p-2 ring-2 ring-[#707FDD]/10 hover:shadow focus:outline-none">
<div className="flex items-center space-x-3">
{staffData?.profile_picture ? (
<img
src={staffData?.profile_picture}
alt={staffData?.name}
className="mr-3 h-8 w-8 rounded-full bg-[#C4C4C4] object-cover"
className="h-8 w-8 rounded-full bg-[#C4C4C4] object-cover"
/>
) : (
<ProfileIcon className="h-8 w-8 rounded-full bg-[#C4C4C4]" />
)}
<span className="text-xs">{staffData?.name}</span>