fix: update import paths after client-side file renames
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -11,12 +11,12 @@ import SettingsPage from './pages/SettingsPage'
|
|||||||
import VacayPage from './pages/VacayPage'
|
import VacayPage from './pages/VacayPage'
|
||||||
import AtlasPage from './pages/AtlasPage'
|
import AtlasPage from './pages/AtlasPage'
|
||||||
import SharedTripPage from './pages/SharedTripPage'
|
import SharedTripPage from './pages/SharedTripPage'
|
||||||
import NotificationsPage from './pages/NotificationsPage'
|
import InAppNotificationsPage from './pages/InAppNotificationsPage.tsx'
|
||||||
import { ToastContainer } from './components/shared/Toast'
|
import { ToastContainer } from './components/shared/Toast'
|
||||||
import { TranslationProvider, useTranslation } from './i18n'
|
import { TranslationProvider, useTranslation } from './i18n'
|
||||||
import { authApi } from './api/client'
|
import { authApi } from './api/client'
|
||||||
import { usePermissionsStore, PermissionLevel } from './store/permissionsStore'
|
import { usePermissionsStore, PermissionLevel } from './store/permissionsStore'
|
||||||
import { useNotificationListener } from './hooks/useNotificationListener'
|
import { useInAppNotificationListener } from './hooks/useInAppNotificationListener.ts'
|
||||||
|
|
||||||
interface ProtectedRouteProps {
|
interface ProtectedRouteProps {
|
||||||
children: ReactNode
|
children: ReactNode
|
||||||
@@ -117,7 +117,7 @@ export default function App() {
|
|||||||
|
|
||||||
const { settings } = useSettingsStore()
|
const { settings } = useSettingsStore()
|
||||||
|
|
||||||
useNotificationListener()
|
useInAppNotificationListener()
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isAuthenticated) {
|
if (isAuthenticated) {
|
||||||
@@ -222,7 +222,7 @@ export default function App() {
|
|||||||
path="/notifications"
|
path="/notifications"
|
||||||
element={
|
element={
|
||||||
<ProtectedRoute>
|
<ProtectedRoute>
|
||||||
<NotificationsPage />
|
<InAppNotificationsPage />
|
||||||
</ProtectedRoute>
|
</ProtectedRoute>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import { useTranslation } from '../../i18n'
|
|||||||
import { useNotificationStore } from '../../store/notificationStore'
|
import { useNotificationStore } from '../../store/notificationStore'
|
||||||
import { useSettingsStore } from '../../store/settingsStore'
|
import { useSettingsStore } from '../../store/settingsStore'
|
||||||
import { useAuthStore } from '../../store/authStore'
|
import { useAuthStore } from '../../store/authStore'
|
||||||
import NotificationItem from '../Notifications/NotificationItem'
|
import InAppNotificationItem from '../Notifications/InAppNotificationItem.tsx'
|
||||||
|
|
||||||
export default function NotificationBell(): React.ReactElement {
|
export default function InAppNotificationBell(): React.ReactElement {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
const { settings } = useSettingsStore()
|
const { settings } = useSettingsStore()
|
||||||
@@ -143,7 +143,7 @@ export default function NotificationBell(): React.ReactElement {
|
|||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
notifications.slice(0, 10).map(n => (
|
notifications.slice(0, 10).map(n => (
|
||||||
<NotificationItem key={n.id} notification={n} onClose={() => setOpen(false)} />
|
<InAppNotificationItem key={n.id} notification={n} onClose={() => setOpen(false)} />
|
||||||
))
|
))
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { useAddonStore } from '../../store/addonStore'
|
|||||||
import { useTranslation } from '../../i18n'
|
import { useTranslation } from '../../i18n'
|
||||||
import { Plane, LogOut, Settings, ChevronDown, Shield, ArrowLeft, Users, Moon, Sun, Monitor, CalendarDays, Briefcase, Globe } from 'lucide-react'
|
import { Plane, LogOut, Settings, ChevronDown, Shield, ArrowLeft, Users, Moon, Sun, Monitor, CalendarDays, Briefcase, Globe } from 'lucide-react'
|
||||||
import type { LucideIcon } from 'lucide-react'
|
import type { LucideIcon } from 'lucide-react'
|
||||||
import NotificationBell from './NotificationBell'
|
import InAppNotificationBell from './InAppNotificationBell.tsx'
|
||||||
|
|
||||||
const ADDON_ICONS: Record<string, LucideIcon> = { CalendarDays, Briefcase, Globe }
|
const ADDON_ICONS: Record<string, LucideIcon> = { CalendarDays, Briefcase, Globe }
|
||||||
|
|
||||||
@@ -165,7 +165,7 @@ export default function Navbar({ tripTitle, tripId, onBack, showBack, onShare }:
|
|||||||
</button>
|
</button>
|
||||||
|
|
||||||
{/* Notification bell */}
|
{/* Notification bell */}
|
||||||
{user && <NotificationBell />}
|
{user && <InAppNotificationBell />}
|
||||||
|
|
||||||
{/* User menu */}
|
{/* User menu */}
|
||||||
{user && (
|
{user && (
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ interface NotificationItemProps {
|
|||||||
onClose?: () => void
|
onClose?: () => void
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function NotificationItem({ notification, onClose }: NotificationItemProps): React.ReactElement {
|
export default function InAppNotificationItem({ notification, onClose }: NotificationItemProps): React.ReactElement {
|
||||||
const { t, locale } = useTranslation()
|
const { t, locale } = useTranslation()
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
const { settings } = useSettingsStore()
|
const { settings } = useSettingsStore()
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { useEffect } from 'react'
|
|||||||
import { addListener, removeListener } from '../api/websocket'
|
import { addListener, removeListener } from '../api/websocket'
|
||||||
import { useNotificationStore } from '../store/notificationStore'
|
import { useNotificationStore } from '../store/notificationStore'
|
||||||
|
|
||||||
export function useNotificationListener(): void {
|
export function useInAppNotificationListener(): void {
|
||||||
const handleNew = useNotificationStore(s => s.handleNewNotification)
|
const handleNew = useNotificationStore(s => s.handleNewNotification)
|
||||||
const handleUpdated = useNotificationStore(s => s.handleUpdatedNotification)
|
const handleUpdated = useNotificationStore(s => s.handleUpdatedNotification)
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { useSettingsStore } from '../store/settingsStore'
|
|||||||
import Navbar from '../components/Layout/Navbar'
|
import Navbar from '../components/Layout/Navbar'
|
||||||
import InAppNotificationItem from '../components/Notifications/InAppNotificationItem.tsx'
|
import InAppNotificationItem from '../components/Notifications/InAppNotificationItem.tsx'
|
||||||
|
|
||||||
export default function NotificationsPage(): React.ReactElement {
|
export default function InAppNotificationsPage(): React.ReactElement {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
const { settings } = useSettingsStore()
|
const { settings } = useSettingsStore()
|
||||||
const darkMode = settings.dark_mode
|
const darkMode = settings.dark_mode
|
||||||
|
|||||||
Reference in New Issue
Block a user