-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add read-only dialog for mobile (#428)
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle } from '@mui/material'; | ||
import useLocalStorage from '../../hooks/useLocalStorage'; | ||
|
||
export default function ReadOnlyDialog() { | ||
const [showReadOnlyMsg, setShowReadOnlyMsg] = useLocalStorage('showReadOnlyMsg', true); | ||
const handleClose = () => { | ||
setShowReadOnlyMsg(false); | ||
}; | ||
return ( | ||
<Dialog | ||
open={showReadOnlyMsg} | ||
onClose={handleClose} | ||
aria-labelledby="alert-dialog-title" | ||
aria-describedby="alert-dialog-description" | ||
> | ||
<DialogTitle id="alert-dialog-title">Quadratic is built for desktop</DialogTitle> | ||
<DialogContent> | ||
<DialogContentText id="alert-dialog-description"> | ||
On mobile, sheets are read-only. To edit sheets, run code, and use the full power of the app, open it on your | ||
desktop computer. | ||
</DialogContentText> | ||
</DialogContent> | ||
<DialogActions> | ||
<Button onClick={handleClose} autoFocus> | ||
Ok, thanks | ||
</Button> | ||
</DialogActions> | ||
</Dialog> | ||
); | ||
} |