bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/common/fullscreen-button/container.jsx
2022-02-15 14:42:02 +00:00

32 lines
928 B
JavaScript

import React from 'react';
import FullscreenButtonComponent from './component';
import { layoutSelect, layoutDispatch } from '/imports/ui/components/layout/context';
import FullscreenService from './service';
const FullscreenButtonContainer = (props) => <FullscreenButtonComponent {...props} />;
export default (props) => {
const handleToggleFullScreen = (ref) => FullscreenService.toggleFullScreen(ref);
const { isFullscreen } = props;
const isIphone = !!(navigator.userAgent.match(/iPhone/i));
const fullscreen = layoutSelect((i) => i.fullscreen);
const { element: currentElement, group: currentGroup } = fullscreen;
const layoutContextDispatch = layoutDispatch();
return (
<FullscreenButtonContainer
{...props}
{...{
handleToggleFullScreen,
isIphone,
isFullscreen,
currentElement,
currentGroup,
layoutContextDispatch,
}}
/>
);
};