Skip to content

armgit / meet

Public Imported from GitHub
0

Open source video conferencing app powered by LiveKit. Built with Django and React.

🚚(frontend) rename NotificationType items

lebaudantoine46934a84d1da
diff --git a/src/frontend/src/features/notifications/MainNotificationToast.tsx b/src/frontend/src/features/notifications/MainNotificationToast.tsx
index deea9ffc..f082cdef 100644
--- a/src/frontend/src/features/notifications/MainNotificationToast.tsx
+++ b/src/frontend/src/features/notifications/MainNotificationToast.tsx
@@ -16,11 +16,11 @@ export const MainNotificationToast = () => {
if (isMobileBrowser()) {
return
}
- triggerNotificationSound(NotificationType.Joined)
+ triggerNotificationSound(NotificationType.ParticipantJoined)
toastQueue.add(
{
participant,
- type: NotificationType.Joined,
+ type: NotificationType.ParticipantJoined,
},
{
timeout: 5000,
@@ -67,7 +67,7 @@ export const MainNotificationToast = () => {
const existingToast = toastQueue.visibleToasts.find(
(toast) =>
toast.content.participant === participant &&
- toast.content.type === NotificationType.Raised
+ toast.content.type === NotificationType.HandRaised
)
if (existingToast && prevMetadata.raised && !metadata.raised) {
@@ -76,11 +76,11 @@ export const MainNotificationToast = () => {
}
if (!existingToast && !prevMetadata.raised && metadata.raised) {
- triggerNotificationSound(NotificationType.Raised)
+ triggerNotificationSound(NotificationType.HandRaised)
toastQueue.add(
{
participant,
- type: NotificationType.Raised,
+ type: NotificationType.HandRaised,
},
{ timeout: 5000 }
)
diff --git a/src/frontend/src/features/notifications/NotificationType.ts b/src/frontend/src/features/notifications/NotificationType.ts
index 6b1570f9..fe74bde6 100644
--- a/src/frontend/src/features/notifications/NotificationType.ts
+++ b/src/frontend/src/features/notifications/NotificationType.ts
@@ -1,6 +1,5 @@
export enum NotificationType {
- Joined = 'joined',
- Default = 'default',
- Raised = 'raised',
- Lowered = 'lowered',
+ ParticipantJoined = 'participantJoined',
+ HandRaised = 'handRaised',
+ // todo - implement message received notification
}
diff --git a/src/frontend/src/features/notifications/components/ToastRegion.tsx b/src/frontend/src/features/notifications/components/ToastRegion.tsx
index 0c0b4ab2..14561095 100644
--- a/src/frontend/src/features/notifications/components/ToastRegion.tsx
+++ b/src/frontend/src/features/notifications/components/ToastRegion.tsx
@@ -17,10 +17,10 @@ export function ToastRegion({ state, ...props }: ToastRegionProps) {
return (
<div {...regionProps} ref={ref} className="toast-region">
{state.visibleToasts.map((toast) => {
- if (toast.content?.type === NotificationType.Joined) {
+ if (toast.content?.type === NotificationType.ParticipantJoined) {
return <ToastJoined key={toast.key} toast={toast} state={state} />
}
- if (toast.content?.type === NotificationType.Raised) {
+ if (toast.content?.type === NotificationType.HandRaised) {
return <ToastRaised key={toast.key} toast={toast} state={state} />
}
return <Toast key={toast.key} toast={toast} state={state} />
diff --git a/src/frontend/src/features/notifications/hooks/useSoundNotification.tsx b/src/frontend/src/features/notifications/hooks/useSoundNotification.tsx
index 145f8110..ce9b3d3e 100644
--- a/src/frontend/src/features/notifications/hooks/useSoundNotification.tsx
+++ b/src/frontend/src/features/notifications/hooks/useSoundNotification.tsx
@@ -4,9 +4,9 @@ import useSound from 'use-sound'
export const useNotificationSound = () => {
const [play] = useSound('./sounds/notifications.mp3', {
sprite: {
- joined: [0, 1150],
- raised: [1400, 180],
- message: [1580, 300],
+ participantJoined: [0, 1150],
+ handRaised: [1400, 180],
+ messageReceived: [1580, 300],
waiting: [2039, 710],
success: [2740, 1304],
},