From 9f8e4438a966289bbe0b2032f252ff24c8a6604f Mon Sep 17 00:00:00 2001 From: Aman Harwara Date: Sat, 5 Mar 2022 15:54:17 +0530 Subject: [PATCH 1/4] feat: add new utility class --- app/assets/stylesheets/_sn.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/assets/stylesheets/_sn.scss b/app/assets/stylesheets/_sn.scss index 4c2fc3caad3..1a9fab412b9 100644 --- a/app/assets/stylesheets/_sn.scss +++ b/app/assets/stylesheets/_sn.scss @@ -396,6 +396,10 @@ min-width: 22.5rem; } +.min-h-min { + min-height: min-content; +} + .min-h-1px { min-height: 1px; } From 7743fbefe7bd79c72a2b7039314eb483a909b546 Mon Sep 17 00:00:00 2001 From: Aman Harwara Date: Sat, 5 Mar 2022 15:54:33 +0530 Subject: [PATCH 2/4] fix: notes list options menu sizing --- .../components/NotesListOptionsMenu.tsx | 291 +++++++++--------- 1 file changed, 144 insertions(+), 147 deletions(-) diff --git a/app/assets/javascripts/components/NotesListOptionsMenu.tsx b/app/assets/javascripts/components/NotesListOptionsMenu.tsx index 2976ed27567..42c7254683e 100644 --- a/app/assets/javascripts/components/NotesListOptionsMenu.tsx +++ b/app/assets/javascripts/components/NotesListOptionsMenu.tsx @@ -16,10 +16,6 @@ type Props = { export const NotesListOptionsMenu: FunctionComponent = observer( ({ closeDisplayOptionsMenu, closeOnBlur, application, isOpen }) => { - const menuClassName = - 'sn-dropdown sn-dropdown--animated min-w-70 overflow-y-auto \ -border-1 border-solid border-main text-sm z-index-dropdown-menu \ -flex flex-col py-2 top-full bottom-0 left-2 absolute'; const [sortBy, setSortBy] = useState(() => application.getPreference(PrefKey.SortNotesBy, CollectionSort.CreatedAt) ); @@ -117,154 +113,155 @@ flex flex-col py-2 top-full bottom-0 left-2 absolute'; application.setPreference(PrefKey.NotesHideEditorIcon, !hideEditorIcon); }; - const menuRef = useRef(null); - return ( -
- +
+ Sort by +
+ -
- Sort by +
+ Date modified + {sortBy === CollectionSort.UpdatedAt ? ( + sortReverse ? ( + + ) : ( + + ) + ) : null}
- -
- Date modified - {sortBy === CollectionSort.UpdatedAt ? ( - sortReverse ? ( - - ) : ( - - ) - ) : null} -
-
- -
- Creation date - {sortBy === CollectionSort.CreatedAt ? ( - sortReverse ? ( - - ) : ( - - ) - ) : null} -
-
- -
- Title - {sortBy === CollectionSort.Title ? ( - sortReverse ? ( - - ) : ( - - ) - ) : null} -
-
- -
- View + + +
+ Creation date + {sortBy === CollectionSort.CreatedAt ? ( + sortReverse ? ( + + ) : ( + + ) + ) : null}
- -
Show note preview
-
- - Show date - - - Show tags - - - Show editor icon - -
-
- Other + + +
+ Title + {sortBy === CollectionSort.Title ? ( + sortReverse ? ( + + ) : ( + + ) + ) : null}
- - Show pinned notes - - - Show protected notes - - - Show archived notes - - - Show trashed notes - -
-
+ + +
+ View +
+ +
Show note preview
+
+ + Show date + + + Show tags + + + Show editor icon + +
+
+ Other +
+ + Show pinned notes + + + Show protected notes + + + Show archived notes + + + Show trashed notes + + ); } ); From 87b8866e07bda0c21dc0cb6ad36743aa515ff7be Mon Sep 17 00:00:00 2001 From: Aman Harwara Date: Sat, 5 Mar 2022 16:10:36 +0530 Subject: [PATCH 3/4] fix: remove unnecessary class --- app/assets/javascripts/components/NotesListOptionsMenu.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/components/NotesListOptionsMenu.tsx b/app/assets/javascripts/components/NotesListOptionsMenu.tsx index 42c7254683e..943911140ae 100644 --- a/app/assets/javascripts/components/NotesListOptionsMenu.tsx +++ b/app/assets/javascripts/components/NotesListOptionsMenu.tsx @@ -116,9 +116,9 @@ export const NotesListOptionsMenu: FunctionComponent = observer( return ( Date: Sat, 5 Mar 2022 16:13:22 +0530 Subject: [PATCH 4/4] feat: remove unnecessary class --- app/assets/stylesheets/_sn.scss | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/assets/stylesheets/_sn.scss b/app/assets/stylesheets/_sn.scss index 1a9fab412b9..4c2fc3caad3 100644 --- a/app/assets/stylesheets/_sn.scss +++ b/app/assets/stylesheets/_sn.scss @@ -396,10 +396,6 @@ min-width: 22.5rem; } -.min-h-min { - min-height: min-content; -} - .min-h-1px { min-height: 1px; }