You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
884 B
25 lines
884 B
import { usePrimaryPage } from '@/PageManager' |
|
import { useNostr } from '@/providers/NostrProvider' |
|
import { useNotification } from '@/providers/NotificationContext' |
|
import { Bell } from 'lucide-react' |
|
import BottomNavigationBarItem from './BottomNavigationBarItem' |
|
|
|
export default function NotificationsButton() { |
|
const { checkLogin } = useNostr() |
|
const { navigate, current, display } = usePrimaryPage() |
|
const { hasNewNotification } = useNotification() |
|
|
|
return ( |
|
<BottomNavigationBarItem |
|
active={current === 'notifications' && display} |
|
onClick={() => checkLogin(() => navigate('notifications'))} |
|
> |
|
<div className="relative"> |
|
<Bell /> |
|
{hasNewNotification && ( |
|
<div className="absolute -top-0.5 right-0.5 w-2 h-2 ring-2 ring-background bg-primary rounded-full" /> |
|
)} |
|
</div> |
|
</BottomNavigationBarItem> |
|
) |
|
}
|
|
|