2019-03-12 00:21:12 +08:00
|
|
|
import React from 'react';
|
|
|
|
import { withTracker } from 'meteor/react-meteor-data';
|
2021-04-01 19:14:24 +08:00
|
|
|
import deviceInfo from '/imports/utils/deviceInfo';
|
|
|
|
import browserInfo from '/imports/utils/browserInfo';
|
2017-05-16 23:37:17 +08:00
|
|
|
import SettingsDropdown from './component';
|
2022-05-14 00:04:23 +08:00
|
|
|
import audioCaptionsService from '/imports/ui/components/audio/captions/service';
|
2022-02-15 22:42:02 +08:00
|
|
|
import FullscreenService from '/imports/ui/components/common/fullscreen-button/service';
|
2019-08-30 00:32:29 +08:00
|
|
|
import { meetingIsBreakout } from '/imports/ui/components/app/service';
|
2022-05-13 21:42:19 +08:00
|
|
|
import { layoutSelectInput, layoutSelect } from '../../layout/context';
|
2022-03-04 02:03:05 +08:00
|
|
|
import { SMALL_VIEWPORT_BREAKPOINT } from '../../layout/enums';
|
2017-05-16 23:37:17 +08:00
|
|
|
|
2021-04-01 19:14:24 +08:00
|
|
|
const { isIphone } = deviceInfo;
|
|
|
|
const { isSafari, isValidSafariVersion } = browserInfo;
|
|
|
|
|
|
|
|
const noIOSFullscreen = !!(((isSafari && !isValidSafariVersion) || isIphone));
|
2019-09-05 02:32:58 +08:00
|
|
|
|
2022-03-04 02:03:05 +08:00
|
|
|
const SettingsDropdownContainer = (props) => {
|
|
|
|
const { width: browserWidth } = layoutSelectInput((i) => i.browser);
|
|
|
|
const isMobile = browserWidth <= SMALL_VIEWPORT_BREAKPOINT;
|
2022-05-13 21:42:19 +08:00
|
|
|
const isRTL = layoutSelect((i) => i.isRTL);
|
2022-03-04 02:03:05 +08:00
|
|
|
|
|
|
|
return (
|
2022-05-13 21:42:19 +08:00
|
|
|
<SettingsDropdown {...{ isMobile, isRTL, ...props }} />
|
2022-03-04 02:03:05 +08:00
|
|
|
);
|
|
|
|
};
|
2019-03-12 00:21:12 +08:00
|
|
|
|
|
|
|
export default withTracker((props) => {
|
2019-07-27 00:48:51 +08:00
|
|
|
const handleToggleFullscreen = () => FullscreenService.toggleFullScreen();
|
2019-03-12 00:21:12 +08:00
|
|
|
return {
|
|
|
|
amIModerator: props.amIModerator,
|
2022-05-14 00:04:23 +08:00
|
|
|
audioCaptionsEnabled: audioCaptionsService.hasAudioCaptions(),
|
|
|
|
audioCaptionsActive: audioCaptionsService.getAudioCaptions(),
|
|
|
|
audioCaptionsSet: (value) => audioCaptionsService.setAudioCaptions(value),
|
|
|
|
isMobile: deviceInfo.isMobile,
|
2019-03-12 00:21:12 +08:00
|
|
|
handleToggleFullscreen,
|
2019-03-13 01:05:32 +08:00
|
|
|
noIOSFullscreen,
|
2019-06-27 00:29:34 +08:00
|
|
|
isMeteorConnected: Meteor.status().connected,
|
2019-08-30 00:32:29 +08:00
|
|
|
isBreakoutRoom: meetingIsBreakout(),
|
2021-05-14 20:47:37 +08:00
|
|
|
isDropdownOpen: Session.get('dropdownOpen'),
|
2019-03-12 00:21:12 +08:00
|
|
|
};
|
|
|
|
})(SettingsDropdownContainer);
|