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

33 lines
966 B
React
Raw Normal View History

2021-06-25 00:47:16 +08:00
import React, { useContext } from 'react';
import FullscreenButtonComponent from './component';
2021-08-05 19:03:24 +08:00
import LayoutContext from '../layout/context';
2021-11-20 03:26:04 +08:00
import FullscreenService from './service';
2021-07-06 22:17:00 +08:00
const FullscreenButtonContainer = (props) => <FullscreenButtonComponent {...props} />;
export default (props) => {
2021-11-20 03:26:04 +08:00
const handleToggleFullScreen = (ref) => FullscreenService.toggleFullScreen(ref);
const { isFullscreen } = props;
2021-07-06 22:17:00 +08:00
const isIphone = !!(navigator.userAgent.match(/iPhone/i));
2021-06-25 00:47:16 +08:00
2021-08-05 19:03:24 +08:00
const layoutContext = useContext(LayoutContext);
const { layoutContextState, layoutContextDispatch } = layoutContext;
const { fullscreen } = layoutContextState;
const { element: currentElement, group: currentGroup } = fullscreen;
2021-06-25 00:47:16 +08:00
return (
2021-07-06 22:17:00 +08:00
<FullscreenButtonContainer
{...props}
{...{
2021-11-20 03:26:04 +08:00
handleToggleFullScreen,
2021-07-06 22:17:00 +08:00
isIphone,
isFullscreen,
currentElement,
currentGroup,
2021-08-05 19:03:24 +08:00
layoutContextDispatch,
2021-07-06 22:17:00 +08:00
}}
/>
);
};