From 498f580dd9e4295f6b56ddc04e5f9b2a80c7677e Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Wed, 26 Feb 2025 17:57:27 +0300 Subject: [PATCH] organize components exports --- apps/web/app/(main)/contacts/page.tsx | 3 +-- apps/web/components/contacts/dropdown-filter.tsx | 2 +- apps/web/components/contacts/index.ts | 2 ++ .../components/navigation/{navbar/index.tsx => bottom-nav.tsx} | 2 +- .../navigation/{header => components}/back-button.tsx | 0 .../navigation/{navbar => components}/nav-button.tsx | 0 .../web/components/navigation/{header/index.tsx => header.tsx} | 2 +- apps/web/components/navigation/index.ts | 2 ++ apps/web/components/navigation/index.tsx | 2 -- 9 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 apps/web/components/contacts/index.ts rename apps/web/components/navigation/{navbar/index.tsx => bottom-nav.tsx} (94%) rename apps/web/components/navigation/{header => components}/back-button.tsx (100%) rename apps/web/components/navigation/{navbar => components}/nav-button.tsx (100%) rename apps/web/components/navigation/{header/index.tsx => header.tsx} (85%) create mode 100644 apps/web/components/navigation/index.ts delete mode 100644 apps/web/components/navigation/index.tsx diff --git a/apps/web/app/(main)/contacts/page.tsx b/apps/web/app/(main)/contacts/page.tsx index 34c2045..8dd9928 100644 --- a/apps/web/app/(main)/contacts/page.tsx +++ b/apps/web/app/(main)/contacts/page.tsx @@ -1,5 +1,4 @@ -import { ContactsList } from '@/components/contacts/contacts-list'; -import { ContactsFilter } from '@/components/contacts/dropdown-filter'; +import { ContactsFilter, ContactsList } from '@/components/contacts'; import { ContactsFilterProvider } from '@/context/contacts-filter'; import { Card } from '@repo/ui/components/ui/card'; diff --git a/apps/web/components/contacts/dropdown-filter.tsx b/apps/web/components/contacts/dropdown-filter.tsx index bc29eda..62645f9 100644 --- a/apps/web/components/contacts/dropdown-filter.tsx +++ b/apps/web/components/contacts/dropdown-filter.tsx @@ -10,7 +10,7 @@ import { import { ChevronDown } from 'lucide-react'; import { use } from 'react'; -const filterLabels: Order = { +const filterLabels: Record = { all: 'Все', clients: 'Клиенты', masters: 'Мастера', diff --git a/apps/web/components/contacts/index.ts b/apps/web/components/contacts/index.ts new file mode 100644 index 0000000..99136a8 --- /dev/null +++ b/apps/web/components/contacts/index.ts @@ -0,0 +1,2 @@ +export * from './contacts-list'; +export * from './dropdown-filter'; diff --git a/apps/web/components/navigation/navbar/index.tsx b/apps/web/components/navigation/bottom-nav.tsx similarity index 94% rename from apps/web/components/navigation/navbar/index.tsx rename to apps/web/components/navigation/bottom-nav.tsx index fcb25e4..8866808 100644 --- a/apps/web/components/navigation/navbar/index.tsx +++ b/apps/web/components/navigation/bottom-nav.tsx @@ -1,5 +1,5 @@ 'use client'; -import { NavButton } from './nav-button'; +import { NavButton } from './components/nav-button'; import { BookOpen, Newspaper, PlusCircle, User, Users } from 'lucide-react'; import { usePathname } from 'next/navigation'; diff --git a/apps/web/components/navigation/header/back-button.tsx b/apps/web/components/navigation/components/back-button.tsx similarity index 100% rename from apps/web/components/navigation/header/back-button.tsx rename to apps/web/components/navigation/components/back-button.tsx diff --git a/apps/web/components/navigation/navbar/nav-button.tsx b/apps/web/components/navigation/components/nav-button.tsx similarity index 100% rename from apps/web/components/navigation/navbar/nav-button.tsx rename to apps/web/components/navigation/components/nav-button.tsx diff --git a/apps/web/components/navigation/header/index.tsx b/apps/web/components/navigation/header.tsx similarity index 85% rename from apps/web/components/navigation/header/index.tsx rename to apps/web/components/navigation/header.tsx index 21424e9..7876515 100644 --- a/apps/web/components/navigation/header/index.tsx +++ b/apps/web/components/navigation/header.tsx @@ -1,5 +1,5 @@ 'use client'; -import { BackButton } from './back-button'; +import { BackButton } from './components/back-button'; type Props = { title: string | undefined }; diff --git a/apps/web/components/navigation/index.ts b/apps/web/components/navigation/index.ts new file mode 100644 index 0000000..db2f2b0 --- /dev/null +++ b/apps/web/components/navigation/index.ts @@ -0,0 +1,2 @@ +export * from './bottom-nav'; +export * from './header'; diff --git a/apps/web/components/navigation/index.tsx b/apps/web/components/navigation/index.tsx deleted file mode 100644 index bb1137c..0000000 --- a/apps/web/components/navigation/index.tsx +++ /dev/null @@ -1,2 +0,0 @@ -export * from './header'; -export * from './navbar';