set readonly on mobile devices

This commit is contained in:
Luck
2022-01-27 23:26:16 +00:00
parent 7d54be07d9
commit ed7f8e5bdd
5 changed files with 28 additions and 1 deletions

View File

@@ -14,6 +14,8 @@ export default function EditorControls({
setForcedContent,
language,
setLanguage,
readOnly,
setReadOnly,
theme,
setTheme,
zoom,
@@ -72,6 +74,10 @@ export default function EditorControls({
document.title = 'paste';
}
function unsetReadOnly() {
setReadOnly(false);
}
return (
<Header>
<Section>
@@ -85,6 +91,7 @@ export default function EditorControls({
setValue={setLanguage}
ids={languages}
/>
{readOnly && <Button onClick={unsetReadOnly}>[edit]</Button>}
</Section>
<Section>
<Button onClick={() => zoom(1)}>[+ </Button>