Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Fullscreen Button #139

Open
yordis opened this issue Sep 20, 2019 · 2 comments
Open

Add Fullscreen Button #139

yordis opened this issue Sep 20, 2019 · 2 comments

Comments

@yordis
Copy link

yordis commented Sep 20, 2019

Using Fullscreen and FullscreenExit combined with Fullscreen API is a common component to have in some backoffice driven apps.

Maybe would be nice to publish this component under Mui Treasure, it depends of #72

Actual code, copied from https://www.npmjs.com/package/@straw-hat/react-fullscreen (I am the author)

import IconButton from '@material-ui/core/IconButton';
import FullscreenIcon from '@material-ui/icons/Fullscreen';
import FullscreenExitIcon from '@material-ui/icons/FullscreenExit';
import * as React from 'react';
import { useFullscreen } from '@straw-hat/react-fullscreen';

export function FullscreenButton() {
  const target = React.useRef(window.document.body);
  const { isFullscreen, toggleFullscreen } = useFullscreen(target);

  return (
    <IconButton color="inherit" onClick={toggleFullscreen}>
      {isFullscreen ? <FullscreenExitIcon /> : <FullscreenIcon />}
    </IconButton>
  );
}

Cheers,

@yordis yordis closed this as completed Nov 12, 2019
@siriwatknp
Copy link
Owner

@yordis Do you still want to add this component? if yes, I will reopen this issue

@yordis
Copy link
Author

yordis commented Jan 5, 2020

@siriwatknp for some reason I just saw this notification,

Honestly, up to you, I know many people love to add this button to admin dashboard and stuff like that so it may be beneficial for multiple people.

Close it if you feel, it doesn't add value.

@yordis yordis reopened this Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants