feat: show login modal when clicking notification without being logged in
This commit is contained in:
@@ -1,16 +1,18 @@
|
|||||||
import { usePrimaryPage } from '@/PageManager'
|
import { usePrimaryPage } from '@/PageManager'
|
||||||
|
import { useNostr } from '@/providers/NostrProvider'
|
||||||
import { useNotification } from '@/providers/NotificationProvider'
|
import { useNotification } from '@/providers/NotificationProvider'
|
||||||
import { Bell } from 'lucide-react'
|
import { Bell } from 'lucide-react'
|
||||||
import BottomNavigationBarItem from './BottomNavigationBarItem'
|
import BottomNavigationBarItem from './BottomNavigationBarItem'
|
||||||
|
|
||||||
export default function NotificationsButton() {
|
export default function NotificationsButton() {
|
||||||
|
const { checkLogin } = useNostr()
|
||||||
const { navigate, current } = usePrimaryPage()
|
const { navigate, current } = usePrimaryPage()
|
||||||
const { hasNewNotification } = useNotification()
|
const { hasNewNotification } = useNotification()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<BottomNavigationBarItem
|
<BottomNavigationBarItem
|
||||||
active={current === 'notifications'}
|
active={current === 'notifications'}
|
||||||
onClick={() => navigate('notifications')}
|
onClick={() => checkLogin(() => navigate('notifications'))}
|
||||||
>
|
>
|
||||||
<div className="relative">
|
<div className="relative">
|
||||||
<Bell />
|
<Bell />
|
||||||
|
|||||||
@@ -1,16 +1,18 @@
|
|||||||
import { usePrimaryPage } from '@/PageManager'
|
import { usePrimaryPage } from '@/PageManager'
|
||||||
|
import { useNostr } from '@/providers/NostrProvider'
|
||||||
import { useNotification } from '@/providers/NotificationProvider'
|
import { useNotification } from '@/providers/NotificationProvider'
|
||||||
import { Bell } from 'lucide-react'
|
import { Bell } from 'lucide-react'
|
||||||
import SidebarItem from './SidebarItem'
|
import SidebarItem from './SidebarItem'
|
||||||
|
|
||||||
export default function NotificationsButton() {
|
export default function NotificationsButton() {
|
||||||
|
const { checkLogin } = useNostr()
|
||||||
const { navigate, current } = usePrimaryPage()
|
const { navigate, current } = usePrimaryPage()
|
||||||
const { hasNewNotification } = useNotification()
|
const { hasNewNotification } = useNotification()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SidebarItem
|
<SidebarItem
|
||||||
title="Notifications"
|
title="Notifications"
|
||||||
onClick={() => navigate('notifications')}
|
onClick={() => checkLogin(() => navigate('notifications'))}
|
||||||
active={current === 'notifications'}
|
active={current === 'notifications'}
|
||||||
>
|
>
|
||||||
<div className="relative">
|
<div className="relative">
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ export function NotificationProvider({ children }: { children: React.ReactNode }
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (hasNewNotification) {
|
if (hasNewNotification) {
|
||||||
document.title = '📩 Jumble'
|
document.title = '📥 Jumble'
|
||||||
} else {
|
} else {
|
||||||
document.title = 'Jumble'
|
document.title = 'Jumble'
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user