Refactor profileBar component to fix notification count display

This commit is contained in:
Pattadon 2024-10-31 15:19:06 +07:00
parent 7d60a209fa
commit 22fe709ce8

View File

@ -33,14 +33,14 @@ const UnAuthenticatedComponents = () => {
}; };
const AuthenticatedComponents = ({ uid }: { uid: string }) => { const AuthenticatedComponents = ({ uid }: { uid: string }) => {
let notifications = 100; let notifications = 1;
const displayValue = notifications >= 100 ? "..." : notifications; const displayValue = notifications >= 100 ? "..." : notifications;
return ( return (
<div className="flex gap-3 pl-2 items-center"> <div className="flex gap-3 pl-2 items-center">
<Link href={"/notification"}> <Link href={"/notification"}>
<div className="relative inline-block"> <div className="relative inline-block">
<Bell className="h-6 w-6 " /> <Bell className="h-6 w-6 " />
<span className="absolute -top-1 -right-1 inline-flex items-center justify-center w-4 h-4 text-xs font-bold text-white bg-red-600 rounded-full"> <span className="absolute -top-1 -right-1 inline-flex items-center justify-center w-4 h-4 text-xs font-bold text-white bg-red-600 rounded-full animate-ping">
{displayValue} {displayValue}
</span> </span>
</div> </div>