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

Improved Full Screen Functionality ( Solved Issue #1006) #1008

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions src/components/NavBar/new/MainNavbar/AlertDialogue.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import * as React from "react";
import Button from "@mui/material/Button";
import Dialog from "@mui/material/Dialog";
import DialogActions from "@mui/material/DialogActions";
import DialogContent from "@mui/material/DialogContent";
import DialogContentText from "@mui/material/DialogContentText";
import DialogTitle from "@mui/material/DialogTitle";
import { signOut } from "../../../../store/actions";
import { useFirebase } from "react-redux-firebase";
import { useDispatch } from "react-redux";

export default function AlertDialog() {
const [open, setOpen] = React.useState(false);

const firebase = useFirebase();
const dispatch = useDispatch();
const handleClickOpen = () => {
setOpen(true);
};

const handleClose = () => {
setOpen(false);
};

const handleLogout = () => {
signOut()(firebase, dispatch);
};

return (
<React.Fragment>
<Button variant="outlined" onClick={handleClickOpen}>
Logout
</Button>
<Dialog
open={open}
onClose={handleClose}
aria-labelledby="alert-dialog-title"
aria-describedby="alert-dialog-description"
>
<DialogTitle id="alert-dialog-title">
{"Do you want to logout from codelabz?"}
</DialogTitle>

<DialogActions>
<Button onClick={handleClose}>Disagree</Button>
<Button onClick={(handleClose, handleLogout)} autoFocus>
Agree
</Button>
</DialogActions>
</Dialog>
</React.Fragment>
);
}
5 changes: 3 additions & 2 deletions src/components/NavBar/new/MainNavbar/RightMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
import { useTheme } from "@mui/styles";
import useMediaQuery from "@mui/material/useMediaQuery";
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
import AlertDialog from "./AlertDialogue";

const useStyles = makeStyles(theme => ({
menu: {
Expand Down Expand Up @@ -361,7 +362,7 @@ const RightMenu = ({ mode, onClick }) => {
)}
<MenuItem
key="setting:4"
onClick={() => signOut()(firebase, dispatch)}
onClick={() => setAnchorEl(null)}
id={"log-out"}
>
<ExitToAppOutlinedIcon />
Expand All @@ -371,7 +372,7 @@ const RightMenu = ({ mode, onClick }) => {
paddingLeft: "0.5rem"
}}
>
Log Out
<AlertDialog />
</Typography>
</MenuItem>
</Menu>
Expand Down
4 changes: 4 additions & 0 deletions src/components/Tutorials/subComps/TutorialTitle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ const TutorialHeading = ({
}
};

document.addEventListener("fullscreenchange", () => {
setFullscreen(document.fullscreenElement !== null);
});

let styleProps = {
backgroundColor: tutorialData.background_color || "#ffffff",
color: tutorialData.text_color || "#000000"
Expand Down
Loading