bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/fullscreen-button/container.jsx

31 lines
1.1 KiB
React
Raw Normal View History

2021-06-25 00:47:16 +08:00
import React, { useContext } from 'react';
import FullscreenButtonComponent from './component';
2019-07-27 00:48:51 +08:00
import FullscreenService from './service';
2021-06-25 00:47:16 +08:00
import { NLayoutContext } from '../layout/context/context';
const FullscreenButtonContainer = props => <FullscreenButtonComponent {...props} />;
export default (props) => {
2019-07-27 00:48:51 +08:00
const handleToggleFullScreen = ref => FullscreenService.toggleFullScreen(ref);
const isIphone = (navigator.userAgent.match(/iPhone/i)) ? true : false;
2021-06-25 00:47:16 +08:00
const newLayoutContext = useContext(NLayoutContext);
const { newLayoutContextState, newLayoutContextDispatch } = newLayoutContext;
const { layoutLoaded: layoutManagerLoaded } = newLayoutContextState;
const { input } = newLayoutContextState;
const { fullscreen } = input;
const { element } = fullscreen;
const isFullscreen = layoutManagerLoaded === 'new' ? !!element : props.isFullscreen;
2021-06-25 00:47:16 +08:00
return (
2021-06-25 00:47:16 +08:00
<FullscreenButtonContainer {...props} {...{
handleToggleFullScreen,
isIphone,
layoutManagerLoaded,
isFullscreen,
element,
2021-06-25 00:47:16 +08:00
newLayoutContextDispatch
}} />
);
};