From 4a0e75c6e57b95361026803454770e97cc0b2edb Mon Sep 17 00:00:00 2001 From: daniel31x13 Date: Sun, 10 Mar 2024 06:08:28 -0400 Subject: [PATCH] improved UX + improved performance --- components/CollectionListing.tsx | 5 +- components/FilterSearchDropdown.tsx | 46 ++++++++++--------- components/LinkViews/Layouts/CardView.tsx | 15 +++++- components/LinkViews/Layouts/ListView.tsx | 12 +++++ components/LinkViews/LinkCard.tsx | 18 +++++--- .../LinkComponents/LinkCollection.tsx | 11 +++-- components/LinkViews/LinkList.tsx | 16 +++++-- components/Navbar.tsx | 2 +- components/SettingsSidebar.tsx | 2 +- hooks/useLinks.tsx | 10 +++- package.json | 3 +- pages/dashboard.tsx | 6 +-- pages/public/collections/[id].tsx | 2 +- pages/search.tsx | 28 ++++++++--- .../migration.sql | 5 ++ .../migration.sql | 2 + prisma/schema.prisma | 4 ++ yarn.lock | 5 ++ 18 files changed, 135 insertions(+), 57 deletions(-) create mode 100644 prisma/migrations/20240310062152_added_indexes/migration.sql create mode 100644 prisma/migrations/20240310062318_added_index_to_ownerid_on_tag_model/migration.sql diff --git a/components/CollectionListing.tsx b/components/CollectionListing.tsx index eb43386..171117b 100644 --- a/components/CollectionListing.tsx +++ b/components/CollectionListing.tsx @@ -47,7 +47,10 @@ const CollectionListing = () => { useEffect(() => { if (account.username) { - if (!account.collectionOrder || account.collectionOrder.length === 0) + if ( + (!account.collectionOrder || account.collectionOrder.length === 0) && + collections.length > 0 + ) updateAccount({ ...account, collectionOrder: collections diff --git a/components/FilterSearchDropdown.tsx b/components/FilterSearchDropdown.tsx index 57a0ea4..01b8906 100644 --- a/components/FilterSearchDropdown.tsx +++ b/components/FilterSearchDropdown.tsx @@ -26,7 +26,7 @@ export default function FilterSearchDropdown({ > -