Skip to content
Snippets Groups Projects
Commit cadc75a2 authored by KDSBrowne's avatar KDSBrowne
Browse files

hide fullscreen buttons from iphones

parent 2c617fed
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,8 @@ export default withTracker((props) => {
const handleToggleFullscreen = () => toggleFullScreen();
const BROWSER_RESULTS = browser();
const isSafari = BROWSER_RESULTS.name === 'safari';
const noIOSFullscreen = isSafari && BROWSER_RESULTS.versionNumber < 12;
const isIphone = navigator.userAgent.match(/iPhone/i);
const noIOSFullscreen = (isSafari && BROWSER_RESULTS.versionNumber < 12) || isIphone;
return {
amIModerator: props.amIModerator,
handleToggleFullscreen,
......
......@@ -36,7 +36,10 @@ const FullscreenButtonComponent = ({
className,
fullscreenRef,
handleToggleFullScreen,
isIphone,
}) => {
if (isIphone) return null;
const formattedLabel = intl.formatMessage(
intlMessages.fullscreenButton,
({ 0: elementName || '' }),
......
......@@ -6,7 +6,8 @@ const FullscreenButtonContainer = props => <FullscreenButtonComponent {...props}
export default (props) => {
const handleToggleFullScreen = ref => toggleFullScreen(ref);
const isIphone = navigator.userAgent.match(/iPhone/i);
return (
<FullscreenButtonContainer {...props} {...{ handleToggleFullScreen }} />
<FullscreenButtonContainer {...props} {...{ handleToggleFullScreen, isIphone }} />
);
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment