Merge pull request #7640 from KDSBrowne/issue-7185

Hide fullscreen buttons from iPhones
This commit is contained in:
Anton Georgiev 2019-06-21 14:51:06 -04:00 committed by GitHub
commit b281174b22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 2 deletions

View File

@ -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,

View File

@ -36,7 +36,10 @@ const FullscreenButtonComponent = ({
className,
fullscreenRef,
handleToggleFullScreen,
isIphone,
}) => {
if (isIphone) return null;
const formattedLabel = intl.formatMessage(
intlMessages.fullscreenButton,
({ 0: elementName || '' }),

View File

@ -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 }} />
);
};