Open source video conferencing app powered by LiveKit. Built with Django and React.
♻️(frontend) extract notification duration in a proper file
lebaudantoine13bb6acdf683
diff --git a/src/frontend/src/features/notifications/MainNotificationToast.tsx b/src/frontend/src/features/notifications/MainNotificationToast.tsxindex 4bddf3c3..96ad0306 100644--- a/src/frontend/src/features/notifications/MainNotificationToast.tsx+++ b/src/frontend/src/features/notifications/MainNotificationToast.tsx@@ -3,23 +3,11 @@ import { useRoomContext } from '@livekit/components-react'import { Participant, RemoteParticipant, RoomEvent } from 'livekit-client'import { ToastProvider, toastQueue } from './components/ToastProvider'import { NotificationType } from './NotificationType'+import { NotificationDuration } from './NotificationDuration'import { Div } from '@/primitives'import { ChatMessage, isMobileBrowser } from '@livekit/components-core'import { useNotificationSound } from '@/features/notifications/hooks/useSoundNotification'-enum ToastDuration {- SHORT = 3000,- MEDIUM = 4000,- LONG = 5000,-}--const NotificationDuration = {- ALERT: ToastDuration.SHORT,- MESSAGE: ToastDuration.LONG,- PARTICIPANT_JOINED: ToastDuration.LONG,- HAND_RAISED: ToastDuration.LONG,-} as const-export const MainNotificationToast = () => {const room = useRoomContext()const { triggerNotificationSound } = useNotificationSound()diff --git a/src/frontend/src/features/notifications/NotificationDuration.ts b/src/frontend/src/features/notifications/NotificationDuration.tsnew file mode 100644index 00000000..7547f56f--- /dev/null+++ b/src/frontend/src/features/notifications/NotificationDuration.ts@@ -0,0 +1,14 @@+export enum ToastDuration {+ SHORT = 3000,+ MEDIUM = 4000,+ LONG = 5000,+ EXTRA_LONG = 7000,+}++export const NotificationDuration = {+ ALERT: ToastDuration.SHORT,+ MESSAGE: ToastDuration.LONG,+ PARTICIPANT_JOINED: ToastDuration.LONG,+ HAND_RAISED: ToastDuration.LONG,+ LOWER_HAND: ToastDuration.EXTRA_LONG,+} as const