2021-03-23 02:02:31 +08:00
|
|
|
import React, { PureComponent } from 'react';
|
2021-10-16 03:07:13 +08:00
|
|
|
import CaptionsButtonContainer from '/imports/ui/components/captions/button/container';
|
2022-05-14 00:04:23 +08:00
|
|
|
import deviceInfo from '/imports/utils/deviceInfo';
|
2021-10-25 21:29:29 +08:00
|
|
|
import Styled from './styles';
|
2021-03-12 09:47:05 +08:00
|
|
|
import ActionsDropdown from './actions-dropdown/container';
|
2022-03-25 03:05:20 +08:00
|
|
|
import AudioCaptionsButtonContainer from '/imports/ui/components/audio/captions/button/container';
|
2023-03-24 21:07:56 +08:00
|
|
|
import CaptionsReaderMenuContainer from '/imports/ui/components/captions/reader-menu/container';
|
2021-03-12 09:47:05 +08:00
|
|
|
import ScreenshareButtonContainer from '/imports/ui/components/actions-bar/screenshare/container';
|
2021-10-14 22:11:37 +08:00
|
|
|
import InteractionsButtonContainer from '/imports/ui/components/actions-bar/interactions-button/container';
|
2021-03-12 09:47:05 +08:00
|
|
|
import AudioControlsContainer from '../audio/audio-controls/container';
|
|
|
|
import JoinVideoOptionsContainer from '../video-provider/video-button/container';
|
|
|
|
import PresentationOptionsContainer from './presentation-options/component';
|
2022-09-22 23:02:19 +08:00
|
|
|
import RaiseHandDropdownContainer from './raise-hand/container';
|
2023-02-23 04:16:43 +08:00
|
|
|
import { isPresentationEnabled } from '/imports/ui/services/features';
|
2016-12-15 03:55:35 +08:00
|
|
|
|
2021-03-23 02:02:31 +08:00
|
|
|
class ActionsBar extends PureComponent {
|
2023-03-24 21:07:56 +08:00
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
|
|
|
|
this.state = {
|
|
|
|
isCaptionsReaderMenuModalOpen: false,
|
|
|
|
};
|
|
|
|
|
|
|
|
this.setCaptionsReaderMenuModalIsOpen = this.setCaptionsReaderMenuModalIsOpen.bind(this);
|
2023-04-29 01:10:27 +08:00
|
|
|
this.setRenderRaiseHand = this.renderRaiseHand.bind(this);
|
2023-06-14 01:51:42 +08:00
|
|
|
this.actionsBarRef = React.createRef();
|
2023-03-24 21:07:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
setCaptionsReaderMenuModalIsOpen(value) {
|
|
|
|
this.setState({ isCaptionsReaderMenuModalOpen: value })
|
|
|
|
}
|
|
|
|
|
2023-04-29 01:10:27 +08:00
|
|
|
renderRaiseHand() {
|
2023-06-08 09:10:07 +08:00
|
|
|
const {
|
|
|
|
isInteractionsButtonEnabled, isRaiseHandButtonEnabled, setEmojiStatus, currentUser, intl,
|
|
|
|
} = this.props;
|
2023-04-29 01:10:27 +08:00
|
|
|
|
|
|
|
return (<>
|
2023-06-14 21:21:33 +08:00
|
|
|
{isInteractionsButtonEnabled ?
|
|
|
|
<>
|
|
|
|
<Styled.Separator />
|
|
|
|
<InteractionsButtonContainer actionsBarRef={this.actionsBarRef} />
|
|
|
|
</> :
|
|
|
|
isRaiseHandButtonEnabled ? <RaiseHandDropdownContainer {...{ setEmojiStatus, currentUser, intl }} />
|
|
|
|
: null}
|
2023-04-29 01:10:27 +08:00
|
|
|
</>);
|
|
|
|
}
|
|
|
|
|
2021-03-12 09:47:05 +08:00
|
|
|
render() {
|
|
|
|
const {
|
|
|
|
amIPresenter,
|
|
|
|
amIModerator,
|
|
|
|
enableVideo,
|
2022-02-11 22:30:35 +08:00
|
|
|
presentationIsOpen,
|
|
|
|
setPresentationIsOpen,
|
2021-03-12 09:47:05 +08:00
|
|
|
handleTakePresenter,
|
|
|
|
intl,
|
|
|
|
isSharingVideo,
|
2023-02-17 23:44:36 +08:00
|
|
|
isSharedNotesPinned,
|
2021-09-28 03:13:06 +08:00
|
|
|
hasScreenshare,
|
2023-03-28 05:40:08 +08:00
|
|
|
hasGenericContent,
|
|
|
|
hasCameraAsContent,
|
2021-03-12 09:47:05 +08:00
|
|
|
stopExternalVideoShare,
|
2023-05-11 04:03:20 +08:00
|
|
|
isTimerActive,
|
|
|
|
isTimerEnabled,
|
2021-03-12 09:47:05 +08:00
|
|
|
isCaptionsAvailable,
|
|
|
|
isMeteorConnected,
|
|
|
|
isPollingEnabled,
|
2021-03-20 02:52:03 +08:00
|
|
|
isSelectRandomUserEnabled,
|
2023-04-29 01:10:27 +08:00
|
|
|
isRaiseHandButtonCentered,
|
2021-03-12 09:47:05 +08:00
|
|
|
isThereCurrentPresentation,
|
|
|
|
allowExternalVideo,
|
2021-08-05 19:03:24 +08:00
|
|
|
layoutContextDispatch,
|
2021-07-22 22:04:38 +08:00
|
|
|
actionsBarStyle,
|
2022-02-08 03:36:21 +08:00
|
|
|
setMeetingLayout,
|
2022-04-26 03:57:11 +08:00
|
|
|
showPushLayout,
|
2022-05-12 05:48:12 +08:00
|
|
|
setPushLayout,
|
2021-03-12 09:47:05 +08:00
|
|
|
} = this.props;
|
2018-01-10 23:44:21 +08:00
|
|
|
|
2023-03-24 21:07:56 +08:00
|
|
|
const { isCaptionsReaderMenuModalOpen } = this.state;
|
|
|
|
|
|
|
|
const shouldShowOptionsButton = (isPresentationEnabled() && isThereCurrentPresentation)
|
|
|
|
|| isSharingVideo || hasScreenshare || isSharedNotesPinned;
|
2021-03-12 09:47:05 +08:00
|
|
|
return (
|
2021-10-25 21:29:29 +08:00
|
|
|
<Styled.ActionsBar
|
2023-06-14 01:51:42 +08:00
|
|
|
ref={this.actionsBarRef}
|
2021-07-22 22:04:38 +08:00
|
|
|
style={
|
2021-08-05 12:22:07 +08:00
|
|
|
{
|
|
|
|
height: actionsBarStyle.innerHeight,
|
|
|
|
}
|
2021-07-22 22:04:38 +08:00
|
|
|
}
|
2021-03-12 09:47:05 +08:00
|
|
|
>
|
2021-10-25 21:29:29 +08:00
|
|
|
<Styled.Left>
|
2021-03-12 09:47:05 +08:00
|
|
|
<ActionsDropdown {...{
|
|
|
|
amIPresenter,
|
|
|
|
amIModerator,
|
|
|
|
isPollingEnabled,
|
2021-03-20 02:52:03 +08:00
|
|
|
isSelectRandomUserEnabled,
|
2021-03-12 09:47:05 +08:00
|
|
|
allowExternalVideo,
|
|
|
|
handleTakePresenter,
|
|
|
|
intl,
|
|
|
|
isSharingVideo,
|
|
|
|
stopExternalVideoShare,
|
2023-05-11 04:03:20 +08:00
|
|
|
isTimerActive,
|
|
|
|
isTimerEnabled,
|
2021-03-12 09:47:05 +08:00
|
|
|
isMeteorConnected,
|
2022-02-08 03:36:21 +08:00
|
|
|
setMeetingLayout,
|
2022-05-12 05:48:12 +08:00
|
|
|
setPushLayout,
|
2022-02-11 22:30:35 +08:00
|
|
|
presentationIsOpen,
|
2022-04-26 03:57:11 +08:00
|
|
|
showPushLayout,
|
2023-03-28 05:40:08 +08:00
|
|
|
hasCameraAsContent,
|
2018-07-10 03:04:24 +08:00
|
|
|
}}
|
2021-03-12 09:47:05 +08:00
|
|
|
/>
|
|
|
|
{isCaptionsAvailable
|
|
|
|
? (
|
2023-03-24 21:07:56 +08:00
|
|
|
<>
|
2023-06-08 09:10:07 +08:00
|
|
|
<CaptionsButtonContainer {...{ intl,
|
2023-03-24 21:07:56 +08:00
|
|
|
setIsOpen: this.setCaptionsReaderMenuModalIsOpen,}} />
|
|
|
|
{
|
|
|
|
isCaptionsReaderMenuModalOpen ? <CaptionsReaderMenuContainer
|
|
|
|
{...{
|
|
|
|
onRequestClose: () => this.setCaptionsReaderMenuModalIsOpen(false),
|
2023-03-29 22:08:56 +08:00
|
|
|
priority: "low",
|
2023-03-24 21:07:56 +08:00
|
|
|
setIsOpen: this.setCaptionsReaderMenuModalIsOpen,
|
|
|
|
isOpen: isCaptionsReaderMenuModalOpen,
|
|
|
|
}}
|
|
|
|
/> : null
|
|
|
|
}
|
|
|
|
</>
|
2021-03-12 09:47:05 +08:00
|
|
|
)
|
2021-05-04 03:04:54 +08:00
|
|
|
: null}
|
2022-05-14 00:04:23 +08:00
|
|
|
{ !deviceInfo.isMobile
|
|
|
|
? (
|
|
|
|
<AudioCaptionsButtonContainer />
|
|
|
|
)
|
|
|
|
: null }
|
2021-10-25 21:29:29 +08:00
|
|
|
</Styled.Left>
|
|
|
|
<Styled.Center>
|
2021-03-12 09:47:05 +08:00
|
|
|
<AudioControlsContainer />
|
|
|
|
{enableVideo
|
|
|
|
? (
|
|
|
|
<JoinVideoOptionsContainer />
|
|
|
|
)
|
|
|
|
: null}
|
|
|
|
<ScreenshareButtonContainer {...{
|
|
|
|
amIPresenter,
|
|
|
|
isMeteorConnected,
|
|
|
|
}}
|
|
|
|
/>
|
2023-04-29 01:10:27 +08:00
|
|
|
{isRaiseHandButtonCentered && this.renderRaiseHand()}
|
2021-10-25 21:29:29 +08:00
|
|
|
</Styled.Center>
|
|
|
|
<Styled.Right>
|
2023-02-17 23:44:36 +08:00
|
|
|
{ shouldShowOptionsButton ?
|
|
|
|
<PresentationOptionsContainer
|
|
|
|
presentationIsOpen={presentationIsOpen}
|
|
|
|
setPresentationIsOpen={setPresentationIsOpen}
|
|
|
|
layoutContextDispatch={layoutContextDispatch}
|
2023-03-14 00:09:31 +08:00
|
|
|
hasPresentation={isThereCurrentPresentation}
|
2023-02-17 23:44:36 +08:00
|
|
|
hasExternalVideo={isSharingVideo}
|
|
|
|
hasScreenshare={hasScreenshare}
|
2023-02-21 23:44:12 +08:00
|
|
|
hasPinnedSharedNotes={isSharedNotesPinned}
|
2023-03-28 05:40:08 +08:00
|
|
|
hasGenericContent={hasGenericContent}
|
|
|
|
hasCameraAsContent={hasCameraAsContent}
|
2023-02-17 23:44:36 +08:00
|
|
|
/>
|
|
|
|
: null
|
|
|
|
}
|
2023-04-29 01:10:27 +08:00
|
|
|
{!isRaiseHandButtonCentered && this.renderRaiseHand()}
|
2021-10-25 21:29:29 +08:00
|
|
|
</Styled.Right>
|
|
|
|
</Styled.ActionsBar>
|
2018-01-10 23:44:21 +08:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2017-03-24 23:37:33 +08:00
|
|
|
|
2022-09-22 23:02:19 +08:00
|
|
|
export default ActionsBar;
|