From 952955310223616f56058c17e819b8798cad2f3a Mon Sep 17 00:00:00 2001 From: Georges-Antoine Assi Date: Sun, 3 Sep 2023 10:05:25 -0400 Subject: [PATCH] Enhancement: apply layout settings to bookmarks (#1902) * Apply layout settings to bookmarks * merge columnMap const * Remove bookmarksOnTop setting --------- Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com> --- .vscode/launch.json | 2 +- src/components/bookmarks/group.jsx | 90 ++++++++++++++++++------------ src/components/bookmarks/list.jsx | 13 ++++- src/components/services/list.jsx | 14 +---- src/pages/index.jsx | 50 ++++++++--------- src/utils/config/api-response.js | 26 ++++++++- src/utils/layout/columns.js | 12 ++++ tailwind.config.js | 11 ++++ 8 files changed, 142 insertions(+), 76 deletions(-) create mode 100644 src/utils/layout/columns.js diff --git a/.vscode/launch.json b/.vscode/launch.json index 0e71c3ba1..366b54388 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -16,4 +16,4 @@ } } ] -} \ No newline at end of file +} diff --git a/src/components/bookmarks/group.jsx b/src/components/bookmarks/group.jsx index 97a484e9c..4cd36b7b8 100644 --- a/src/components/bookmarks/group.jsx +++ b/src/components/bookmarks/group.jsx @@ -5,44 +5,64 @@ import { MdKeyboardArrowDown } from "react-icons/md"; import ErrorBoundary from "components/errorboundry"; import List from "components/bookmarks/list"; +import ResolvedIcon from "components/resolvedicon"; -export default function BookmarksGroup({ group, disableCollapse }) { +export default function BookmarksGroup({ bookmarks, layout, disableCollapse }) { const panel = useRef(); return ( -
- - {({ open }) => ( - <> - -

{group.name}

- -
- { - panel.current.style.height = `${panel.current.scrollHeight}px`; - setTimeout(() => {panel.current.style.height = `0`}, 1); - }} - beforeEnter={() => { - panel.current.style.height = `0px`; - setTimeout(() => {panel.current.style.height = `${panel.current.scrollHeight}px`}, 1); - }} - > - - - - - - - - )} -
+
+ + {({ open }) => ( + <> + {layout?.header !== false && ( + + {layout?.icon && ( +
+ +
+ )} +

{bookmarks.name}

+ +
+ )} + { + panel.current.style.height = `${panel.current.scrollHeight}px`; + setTimeout(() => { + panel.current.style.height = `0`; + }, 1); + }} + beforeEnter={() => { + panel.current.style.height = `0px`; + setTimeout(() => { + panel.current.style.height = `${panel.current.scrollHeight}px`; + }, 1); + }} + > + + + + + + + + )} +
); } diff --git a/src/components/bookmarks/list.jsx b/src/components/bookmarks/list.jsx index d37b83e79..e0266d303 100644 --- a/src/components/bookmarks/list.jsx +++ b/src/components/bookmarks/list.jsx @@ -1,8 +1,17 @@ +import classNames from "classnames"; + +import { columnMap } from "../../utils/layout/columns"; + import Item from "components/bookmarks/item"; -export default function List({ bookmarks }) { +export default function List({ bookmarks, layout }) { return ( -