From 6917a2fcca150f6196cd9497a4e3b415f8549da0 Mon Sep 17 00:00:00 2001 From: Georges-Antoine Assi Date: Sun, 3 Sep 2023 09:48:26 -0400 Subject: [PATCH] Remove bookmarksOnTop setting --- src/pages/index.jsx | 70 ++++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 42 deletions(-) diff --git a/src/pages/index.jsx b/src/pages/index.jsx index ef869802..dc794a15 100644 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -4,7 +4,7 @@ import Head from "next/head"; import dynamic from "next/dynamic"; import classNames from "classnames"; import { useTranslation } from "next-i18next"; -import { useEffect, useContext, useState, useMemo } from "react"; +import { useEffect, useContext, useState } from "react"; import { BiError } from "react-icons/bi"; import { serverSideTranslations } from "next-i18next/serverSideTranslations"; @@ -230,46 +230,6 @@ function Home({ initialSettings }) { } }) - const servicesAndBookmarksGroups = useMemo(() => { - const mergedGroups = [ - services?.length > 0 ? ( -
- {services.map((group) => ( - - ))} -
- ) : null, - bookmarks?.length > 0 ? ( -
- {bookmarks.map((group) => ( - - ))} -
- ) : null - ]; - - return settings.bookmarksOnTop ? mergedGroups.reverse() : mergedGroups; - }, [ - services, - bookmarks, - settings.layout, - settings.fiveColumns, - settings.disableCollapse, - settings.bookmarksOnTop - ]); - return ( <> @@ -329,7 +289,33 @@ function Home({ initialSettings }) { )} - {servicesAndBookmarksGroups} + {services?.length > 0 && ( +
+ {services.map((group) => ( + + ))} +
+ )} + + {bookmarks?.length > 0 && ( +
+ {bookmarks.map((group) => ( + + ))} +
+ )}