Added note text only mode

This commit is contained in:
Mitchell McCaffrey
2021-01-25 10:03:20 +11:00
parent 55b9be4e2d
commit feb803ebef
5 changed files with 63 additions and 12 deletions

View File

@@ -13,6 +13,8 @@ import LockIcon from "../../icons/TokenLockIcon";
import UnlockIcon from "../../icons/TokenUnlockIcon";
import ShowIcon from "../../icons/TokenShowIcon";
import HideIcon from "../../icons/TokenHideIcon";
import NoteIcon from "../../icons/NoteToolIcon";
import TextIcon from "../../icons/NoteTextIcon";
import AuthContext from "../../contexts/AuthContext";
@@ -75,6 +77,10 @@ function NoteMenu({
note && onNoteChange({ ...note, locked: !note.locked });
}
function handleModeChange() {
note && onNoteChange({ ...note, textOnly: !note.textOnly });
}
function handleModalContent(node) {
if (node) {
// Focus input
@@ -209,6 +215,13 @@ function NoteMenu({
>
{note && note.locked ? <LockIcon /> : <UnlockIcon />}
</IconButton>
<IconButton
onClick={handleModeChange}
title={note && note.textOnly ? "Note Mode" : "Text Mode"}
aria-label={note && note.textOnly ? "Note Mode" : "Text Mode"}
>
{note && note.textOnly ? <TextIcon /> : <NoteIcon />}
</IconButton>
</Flex>
)}
</Box>