Commit 12bb82c0 authored by Shehan Liyanage's avatar Shehan Liyanage

Merge branch 'SignLanguage-new-Changes' into 'develop'

add sweetAlert

See merge request !13
parents 298b19eb bbee5a38
import React, { useEffect, useRef, useState } from 'react'
import { Box } from '@mui/material'
import { useTheme, Theme } from '@mui/material/styles'
import Swal from 'sweetalert2' // Import SweetAlert2
import { useRemoteUsers, usePublish, useRTCClient, useClientEvent } from 'agora-rtc-react'
import SymmetricGrid from '../SymmetricGrid/SymmetricGrid'
import PinnedGrid from '../PinnedGrid/PinnedGrid'
......@@ -33,6 +34,7 @@ const MeetingLayout = ({ setJoined, localCameraTrack, localMicrophoneTrack }: Pr
const [isPinned, setIsPinned] = useState(false)
const [pinnedUser, setPinnedUser] = useState<IAgoraRTCRemoteUser | null>(null)
const [isCaptionEnable, setIsCaptionEnable] = useState(false)
const [isMeetingStarted, setIsMeetingStarted] = useState(false)
useEffect(() => {
setTotalUsers(remoteUsers.length + 1)
......@@ -53,6 +55,22 @@ const MeetingLayout = ({ setJoined, localCameraTrack, localMicrophoneTrack }: Pr
useClientEvent(agoraEngine, 'user-left', handleUserLeft)
// Show a popup when the meeting starts
useEffect(() => {
if (!isMeetingStarted) {
void Swal.fire({
title: 'Meeting Started',
text: 'Sign language prediction might be delayed due to the live meeting.',
icon: 'info',
timer: 5000, // Display the popup for 5 seconds
timerProgressBar: true,
willClose: () => {
setIsMeetingStarted(true)
},
})
}
}, [isMeetingStarted])
return (
<Box
sx={{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment