From 6423ed8fb51fd0e0eb3745526fe07f7f6bc17a40 Mon Sep 17 00:00:00 2001 From: Robert Pintilii Date: Tue, 11 Oct 2022 11:24:11 +0300 Subject: [PATCH] ref(ui-components) Use new Dialog component (#12351) Convert some files to TS --- react/features/base/dialog/middleware.web.ts | 10 +++++- .../base/ui/components/web/ClickableIcon.tsx | 4 ++- .../base/ui/components/web/Dialog.tsx | 8 ++++- ...log.js => AbstractGrantModeratorDialog.ts} | 36 ++++++++----------- ...=> AbstractKickRemoteParticipantDialog.ts} | 27 +++++--------- ...atorDialog.js => GrantModeratorDialog.tsx} | 16 ++++----- ...log.js => KickRemoteParticipantDialog.tsx} | 18 ++++------ ... => MuteRemoteParticipantsVideoDialog.tsx} | 16 ++++----- .../components/VideoQualityDialog.web.js | 9 +++-- .../components/UploadImageButton.tsx | 1 - .../components/VirtualBackgroundDialog.tsx | 32 ++++++++--------- .../components/VirtualBackgroundPreview.tsx | 1 - 12 files changed, 79 insertions(+), 99 deletions(-) rename react/features/video-menu/components/{AbstractGrantModeratorDialog.js => AbstractGrantModeratorDialog.ts} (69%) rename react/features/video-menu/components/{AbstractKickRemoteParticipantDialog.js => AbstractKickRemoteParticipantDialog.ts} (71%) rename react/features/video-menu/components/web/{GrantModeratorDialog.js => GrantModeratorDialog.tsx} (63%) rename react/features/video-menu/components/web/{KickRemoteParticipantDialog.js => KickRemoteParticipantDialog.tsx} (59%) rename react/features/video-menu/components/web/{MuteRemoteParticipantsVideoDialog.js => MuteRemoteParticipantsVideoDialog.tsx} (75%) diff --git a/react/features/base/dialog/middleware.web.ts b/react/features/base/dialog/middleware.web.ts index 1ea7bf202..c5a23881b 100644 --- a/react/features/base/dialog/middleware.web.ts +++ b/react/features/base/dialog/middleware.web.ts @@ -21,8 +21,14 @@ import SecurityDialog from '../../security/components/security-dialog/web/Securi import SharedVideoDialog from '../../shared-video/components/web/SharedVideoDialog'; import SpeakerStats from '../../speaker-stats/components/web/SpeakerStats'; import LanguageSelectorDialog from '../../subtitles/components/LanguageSelectorDialog.web'; +import GrantModeratorDialog from '../../video-menu/components/web/GrantModeratorDialog'; +import KickRemoteParticipantDialog from '../../video-menu/components/web/KickRemoteParticipantDialog'; import MuteEveryoneDialog from '../../video-menu/components/web/MuteEveryoneDialog'; import MuteEveryonesVideoDialog from '../../video-menu/components/web/MuteEveryonesVideoDialog'; +import MuteRemoteParticipantsVideoDialog from '../../video-menu/components/web/MuteRemoteParticipantsVideoDialog'; +// @ts-ignore +import VideoQualityDialog from '../../video-quality/components/VideoQualityDialog.web'; +import VirtualBackgroundDialog from '../../virtual-background/components/VirtualBackgroundDialog'; import MiddlewareRegistry from '../redux/MiddlewareRegistry'; import { OPEN_DIALOG } from './actionTypes'; @@ -33,7 +39,9 @@ import { OPEN_DIALOG } from './actionTypes'; const NEW_DIALOG_LIST = [ KeyboardShortcutsDialog, ChatPrivacyDialog, DisplayNamePrompt, EmbedMeetingDialog, FeedbackDialog, AddPeopleDialog, PremiumFeatureDialog, StartLiveStreamDialog, StopLiveStreamDialog, StartRecordingDialog, StopRecordingDialog, ShareAudioDialog, ShareScreenWarningDialog, SecurityDialog, - SharedVideoDialog, SpeakerStats, LanguageSelectorDialog, MuteEveryoneDialog, MuteEveryonesVideoDialog ]; + SharedVideoDialog, SpeakerStats, LanguageSelectorDialog, MuteEveryoneDialog, MuteEveryonesVideoDialog, + GrantModeratorDialog, KickRemoteParticipantDialog, MuteRemoteParticipantsVideoDialog, VideoQualityDialog, + VirtualBackgroundDialog ]; // This function is necessary while the transition from @atlaskit dialog to our component is ongoing. const isNewDialog = (component: any) => NEW_DIALOG_LIST.some(comp => comp === component); diff --git a/react/features/base/ui/components/web/ClickableIcon.tsx b/react/features/base/ui/components/web/ClickableIcon.tsx index 8dde79d1c..79a426296 100644 --- a/react/features/base/ui/components/web/ClickableIcon.tsx +++ b/react/features/base/ui/components/web/ClickableIcon.tsx @@ -8,6 +8,7 @@ import Icon from '../../../icons/components/Icon'; interface IProps { accessibilityLabel: string; icon: Function; + id?: string; onClick: () => void; } @@ -40,7 +41,7 @@ const useStyles = makeStyles()((theme: Theme) => { }; }); -const ClickableIcon = ({ accessibilityLabel, icon, onClick }: IProps) => { +const ClickableIcon = ({ accessibilityLabel, icon, id, onClick }: IProps) => { const { classes: styles, cx } = useStyles(); const isMobile = isMobileBrowser(); @@ -48,6 +49,7 @@ const ClickableIcon = ({ accessibilityLabel, icon, onClick }: IProps) => {