bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/nav-bar/settings-dropdown/container.jsx

31 lines
1.0 KiB
React
Raw Normal View History

2019-03-12 00:21:12 +08:00
import React from 'react';
import { withTracker } from 'meteor/react-meteor-data';
2021-03-30 20:53:47 +08:00
import Bowser from 'bowser';
import SettingsDropdown from './component';
2019-07-27 00:48:51 +08:00
import FullscreenService from '../../fullscreen-button/service';
2019-08-30 00:32:29 +08:00
import { meetingIsBreakout } from '/imports/ui/components/app/service';
2021-03-30 20:53:47 +08:00
const BROWSER_RESULTS = Bowser.getParser(window.navigator.userAgent);
const isSafari = BROWSER_RESULTS.getBrowserName() === 'Safari';
const isIphone = !!(navigator.userAgent.match(/iPhone/i));
const isValidBrowserVersion = BROWSER_RESULTS.satisfies({
safari: '>12',
});
const noIOSFullscreen = !!(((isSafari && !isValidBrowserVersion) || isIphone));
2019-09-05 02:32:58 +08:00
2019-03-12 00:21:12 +08:00
const SettingsDropdownContainer = props => (
<SettingsDropdown {...props} />
);
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,
handleToggleFullscreen,
noIOSFullscreen,
2019-06-27 00:29:34 +08:00
isMeteorConnected: Meteor.status().connected,
2019-08-30 00:32:29 +08:00
isBreakoutRoom: meetingIsBreakout(),
2019-03-12 00:21:12 +08:00
};
})(SettingsDropdownContainer);