diff --git a/app/assets/javascripts/Components/ContentListView/NotesListOptionsMenu.tsx b/app/assets/javascripts/Components/ContentListView/ContentListOptionsMenu.tsx similarity index 91% rename from app/assets/javascripts/Components/ContentListView/NotesListOptionsMenu.tsx rename to app/assets/javascripts/Components/ContentListView/ContentListOptionsMenu.tsx index 569b8650f..0e21af840 100644 --- a/app/assets/javascripts/Components/ContentListView/NotesListOptionsMenu.tsx +++ b/app/assets/javascripts/Components/ContentListView/ContentListOptionsMenu.tsx @@ -1,5 +1,5 @@ import { WebApplication } from '@/UIModels/Application' -import { CollectionSort, CollectionSortProperty, PrefKey } from '@standardnotes/snjs' +import { CollectionSort, CollectionSortProperty, PrefKey, SystemViewId } from '@standardnotes/snjs' import { observer } from 'mobx-react-lite' import { FunctionComponent, useCallback, useState } from 'react' import Icon from '@/Components/Icon/Icon' @@ -7,18 +7,21 @@ import Menu from '@/Components/Menu/Menu' import MenuItem from '@/Components/Menu/MenuItem' import MenuItemSeparator from '@/Components/Menu/MenuItemSeparator' import { MenuItemType } from '@/Components/Menu/MenuItemType' +import { AppState } from '@/UIModels/AppState' type Props = { application: WebApplication + appState: AppState closeOnBlur: (event: { relatedTarget: EventTarget | null }) => void closeDisplayOptionsMenu: () => void isOpen: boolean } -const NotesListOptionsMenu: FunctionComponent = ({ +const ContentListOptionsMenu: FunctionComponent = ({ closeDisplayOptionsMenu, closeOnBlur, application, + appState, isOpen, }) => { const [sortBy, setSortBy] = useState(() => application.getPreference(PrefKey.SortNotesBy, CollectionSort.CreatedAt)) @@ -171,15 +174,17 @@ const NotesListOptionsMenu: FunctionComponent = ({
View
- -
Show note preview
-
+ {appState.tags.selectedUuid !== SystemViewId.Files && ( + +
Show note preview
+
+ )} = ({ onChange={toggleEditorIcon} onBlur={closeOnBlur} > - Show editor icon + Show icon
Other
@@ -216,7 +221,7 @@ const NotesListOptionsMenu: FunctionComponent = ({ onChange={toggleHidePinned} onBlur={closeOnBlur} > - Show pinned notes + Show pinned = ({ onChange={toggleHideProtected} onBlur={closeOnBlur} > - Show protected notes + Show protected = ({ onChange={toggleShowArchived} onBlur={closeOnBlur} > - Show archived notes + Show archived = ({ onChange={toggleShowTrashed} onBlur={closeOnBlur} > - Show trashed notes + Show trashed ) } -export default observer(NotesListOptionsMenu) +export default observer(ContentListOptionsMenu) diff --git a/app/assets/javascripts/Components/ContentListView/ContentListView.tsx b/app/assets/javascripts/Components/ContentListView/ContentListView.tsx index 27c419f00..30d086a4d 100644 --- a/app/assets/javascripts/Components/ContentListView/ContentListView.tsx +++ b/app/assets/javascripts/Components/ContentListView/ContentListView.tsx @@ -15,12 +15,12 @@ import { useState, } from 'react' import ContentList from '@/Components/ContentListView/ContentList' -import NotesListOptionsMenu from '@/Components/ContentListView/NotesListOptionsMenu' import NoAccountWarningWrapper from '@/Components/NoAccountWarning/NoAccountWarning' import SearchOptions from '@/Components/SearchOptions/SearchOptions' import PanelResizer, { PanelSide, ResizeFinishCallback, PanelResizeType } from '@/Components/PanelResizer/PanelResizer' import { Disclosure, DisclosureButton, DisclosurePanel } from '@reach/disclosure' import { useCloseOnBlur } from '@/Hooks/useCloseOnBlur' +import ContentListOptionsMenu from './ContentListOptionsMenu' type Props = { application: WebApplication @@ -233,8 +233,9 @@ const ContentListView: FunctionComponent = ({ application, appState }) => {showDisplayOptionsMenu && ( - = ({ return (