From 5a8bda0322b8818e24e2016b2eb9ca35a6cbdeb0 Mon Sep 17 00:00:00 2001 From: Sonny Date: Tue, 14 May 2024 13:19:49 +0200 Subject: [PATCH] refactor: rename link_list with a proper name --- .../collection_container.tsx} | 33 ++++--------------- .../{link_list => link}/link_controls.tsx | 0 .../{link_list => link}/link_item.tsx | 2 +- .../components/dashboard/link/link_list.tsx | 31 +++++++++++++++++ .../dashboard/{link_list => link}/no_item.tsx | 0 inertia/pages/dashboard.tsx | 4 +-- 6 files changed, 40 insertions(+), 30 deletions(-) rename inertia/components/dashboard/{link_list/link_list.tsx => collection/collection_container.tsx} (69%) rename inertia/components/dashboard/{link_list => link}/link_controls.tsx (100%) rename inertia/components/dashboard/{link_list => link}/link_item.tsx (97%) create mode 100644 inertia/components/dashboard/link/link_list.tsx rename inertia/components/dashboard/{link_list => link}/no_item.tsx (100%) diff --git a/inertia/components/dashboard/link_list/link_list.tsx b/inertia/components/dashboard/collection/collection_container.tsx similarity index 69% rename from inertia/components/dashboard/link_list/link_list.tsx rename to inertia/components/dashboard/collection/collection_container.tsx index 58ef0ab..4dff6c9 100644 --- a/inertia/components/dashboard/link_list/link_list.tsx +++ b/inertia/components/dashboard/collection/collection_container.tsx @@ -4,8 +4,8 @@ import { RxHamburgerMenu } from 'react-icons/rx'; import CollectionControls from '~/components/dashboard/collection/collection_controls'; import CollectionDescription from '~/components/dashboard/collection/collection_description'; import CollectionHeader from '~/components/dashboard/collection/collection_header'; -import LinkItem from '~/components/dashboard/link_list/link_item'; -import { NoCollection, NoLink } from '~/components/dashboard/link_list/no_item'; +import LinkList from '~/components/dashboard/link/link_list'; +import { NoCollection } from '~/components/dashboard/link/no_item'; import Footer from '~/components/footer/footer'; import useActiveCollection from '~/hooks/use_active_collection'; @@ -32,15 +32,15 @@ const CollectionHeaderWrapper = styled.h2(({ theme }) => ({ }, })); -interface LinksProps { +interface CollectionContainerProps { isMobile: boolean; openSideMenu: () => void; } -export default function Links({ +export default function CollectionContainer({ isMobile, openSideMenu, -}: Readonly) { +}: Readonly) { const { activeCollection } = useActiveCollection(); if (activeCollection === null) { @@ -66,29 +66,8 @@ export default function Links({ - {activeCollection?.links.length !== 0 ? ( - - {activeCollection?.links.map((link) => ( - - ))} - - ) : ( - - )} +