Skip to content

Commit

Permalink
feat: Open zoom meetings in a new tab (#663)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeangelLF authored Sep 18, 2024
1 parent 077c275 commit 3d27423
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/modals/AdHocMeetingModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const AdHocMeetingModal = ({ isOpen, onOpenChange, matchId }: ModalProps) => {
setIsBrowserMeeting(true);
const response = await createMeeting();
if (response) {
navigate(`/video-chat/${response.appointmentId}/${response.appointmentType}`);
window.open(`/video-chat/${response.appointmentId}/${response.appointmentType}`);
}
};

Expand All @@ -63,7 +63,7 @@ const AdHocMeetingModal = ({ isOpen, onOpenChange, matchId }: ModalProps) => {
if (response.zoomUrl) {
window.open(response.zoomUrl, '_self');
} else {
navigate(`/video-chat/${response.appointmentId}/${response.appointmentType}`);
window.open(`/video-chat/${response.appointmentId}/${response.appointmentType}`);
}
};

Expand Down
8 changes: 5 additions & 3 deletions src/modals/ZoomMeetingModal.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Trans, useTranslation } from 'react-i18next';
import { Lecture_Appointmenttype_Enum } from '../gql/graphql';
import { useNavigate } from 'react-router-dom';
import CheckBadge from '../assets/icons/check-badge.svg';
import CameraIcon from '../assets/icons/camera-icon.svg';
import { BaseModalProps, Modal, ModalFooter, ModalHeader, ModalTitle } from '@/components/Modal';
Expand Down Expand Up @@ -50,7 +49,10 @@ export const ZoomInfoOptions = () => {

const ZoomMeetingModal: React.FC<ZoomMeetingModalProps> = ({ isOpen, onOpenChange, appointmentId, appointmentType, zoomUrl }) => {
const { t } = useTranslation();
const navigate = useNavigate();

const handleOnContinueInBrowser = () => {
window.open(`/video-chat/${appointmentId}/${appointmentType}`);
};

return (
<Modal onOpenChange={onOpenChange} isOpen={isOpen}>
Expand All @@ -61,7 +63,7 @@ const ZoomMeetingModal: React.FC<ZoomMeetingModalProps> = ({ isOpen, onOpenChang
<ZoomInfoOptions />
</div>
<ModalFooter>
<Button className="w-full" variant="outline" onClick={() => navigate(`/video-chat/${appointmentId}/${appointmentType}`)}>
<Button className="w-full" variant="outline" onClick={handleOnContinueInBrowser}>
{t('appointment.zoomModal.browser')}
</Button>
<Button className="w-full" disabled={!zoomUrl} onClick={() => window.open(zoomUrl, '_self')}>
Expand Down

0 comments on commit 3d27423

Please sign in to comment.