feat: add protect option to menu

This commit is contained in:
Antonella Sgarlatta
2021-05-11 17:09:23 -03:00
parent b3380cf323
commit 8302733a49
6 changed files with 80 additions and 35 deletions

View File

@@ -35,6 +35,7 @@ export const NotesOptions = observer(
const notes = Object.values(appState.notes.selectedNotes);
const hidePreviews = toggleOn(note => note.hidePreview);
const locked = toggleOn(note => note.locked);
const protect = toggleOn(note => note.protected);
const archived = notes.some((note) => note.archived);
const unarchived = notes.some((note) => !note.archived);
const trashed = notes.some((note) => note.trashed);
@@ -84,6 +85,19 @@ export const NotesOptions = observer(
Show preview
</span>
</Switch>
<Switch
onBlur={closeOnBlur}
className="px-3 py-1.5"
checked={protect}
onChange={() => {
appState.notes.setProtectSelectedNotes(!protect);
}}
>
<span className="flex items-center">
<Icon type="password" className={iconClass} />
Protect
</span>
</Switch>
<div className="h-1px my-2 bg-border"></div>
{appState.tags.tagsCount > 0 && (
<Disclosure