2021-03-12 09:47:05 +08:00
|
|
|
import React, { PureComponent } from 'react';
|
|
|
|
import cx from 'classnames';
|
|
|
|
import { styles } from './styles.scss';
|
|
|
|
import ActionsDropdown from './actions-dropdown/container';
|
|
|
|
import ScreenshareButtonContainer from '/imports/ui/components/actions-bar/screenshare/container';
|
|
|
|
import AudioControlsContainer from '../audio/audio-controls/container';
|
|
|
|
import JoinVideoOptionsContainer from '../video-provider/video-button/container';
|
|
|
|
import CaptionsButtonContainer from '/imports/ui/components/actions-bar/captions/container';
|
|
|
|
import PresentationOptionsContainer from './presentation-options/component';
|
|
|
|
import { ACTIONSBAR_HEIGHT } from '/imports/ui/components/layout/layout-manager';
|
2016-12-15 03:55:35 +08:00
|
|
|
|
2021-03-12 09:47:05 +08:00
|
|
|
class ActionsBar extends PureComponent {
|
|
|
|
render() {
|
|
|
|
const {
|
|
|
|
amIPresenter,
|
|
|
|
amIModerator,
|
|
|
|
enableVideo,
|
|
|
|
isLayoutSwapped,
|
|
|
|
toggleSwapLayout,
|
|
|
|
handleTakePresenter,
|
|
|
|
intl,
|
|
|
|
isSharingVideo,
|
|
|
|
stopExternalVideoShare,
|
|
|
|
isCaptionsAvailable,
|
|
|
|
isMeteorConnected,
|
|
|
|
isPollingEnabled,
|
|
|
|
isPresentationDisabled,
|
|
|
|
isThereCurrentPresentation,
|
|
|
|
allowExternalVideo,
|
|
|
|
} = this.props;
|
2018-01-10 23:44:21 +08:00
|
|
|
|
2021-03-12 09:47:05 +08:00
|
|
|
const actionBarClasses = {};
|
2018-11-30 01:24:02 +08:00
|
|
|
|
2021-03-12 09:47:05 +08:00
|
|
|
actionBarClasses[styles.centerWithActions] = amIPresenter;
|
|
|
|
actionBarClasses[styles.center] = true;
|
|
|
|
actionBarClasses[styles.mobileLayoutSwapped] = isLayoutSwapped && amIPresenter;
|
2018-01-10 23:44:21 +08:00
|
|
|
|
2021-03-12 09:47:05 +08:00
|
|
|
return (
|
|
|
|
<div
|
|
|
|
className={styles.actionsbar}
|
|
|
|
style={{
|
|
|
|
height: ACTIONSBAR_HEIGHT,
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<div className={styles.left}>
|
|
|
|
<ActionsDropdown {...{
|
|
|
|
amIPresenter,
|
|
|
|
amIModerator,
|
|
|
|
isPollingEnabled,
|
|
|
|
allowExternalVideo,
|
|
|
|
handleTakePresenter,
|
|
|
|
intl,
|
|
|
|
isSharingVideo,
|
|
|
|
stopExternalVideoShare,
|
|
|
|
isMeteorConnected,
|
2018-07-10 03:04:24 +08:00
|
|
|
}}
|
2021-03-12 09:47:05 +08:00
|
|
|
/>
|
|
|
|
{isCaptionsAvailable
|
|
|
|
? (
|
|
|
|
<CaptionsButtonContainer {...{ intl }} />
|
|
|
|
)
|
|
|
|
: null
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
<div className={cx(actionBarClasses)}>
|
|
|
|
<AudioControlsContainer />
|
|
|
|
{enableVideo
|
|
|
|
? (
|
|
|
|
<JoinVideoOptionsContainer />
|
|
|
|
)
|
|
|
|
: null}
|
|
|
|
<ScreenshareButtonContainer {...{
|
|
|
|
amIPresenter,
|
|
|
|
isMeteorConnected,
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div className={styles.right}>
|
|
|
|
{isLayoutSwapped && !isPresentationDisabled
|
|
|
|
? (
|
|
|
|
<PresentationOptionsContainer
|
|
|
|
toggleSwapLayout={toggleSwapLayout}
|
|
|
|
isThereCurrentPresentation={isThereCurrentPresentation}
|
|
|
|
/>
|
|
|
|
)
|
|
|
|
: null
|
2018-12-15 04:16:15 +08:00
|
|
|
}
|
|
|
|
</div>
|
2018-01-10 23:44:21 +08:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2017-03-24 23:37:33 +08:00
|
|
|
|
2020-09-04 07:35:57 +08:00
|
|
|
export default ActionsBar;
|