From 02a24640c4059edc0afeffc1077e0463c1b22924 Mon Sep 17 00:00:00 2001 From: Gabo Esquivel Date: Mon, 8 Apr 2024 09:40:26 -0600 Subject: [PATCH] chore: move shared components --- .../app/(browse)/[category]/[threadId]/page.tsx | 10 +++++----- apps/masterbots.ai/app/(browse)/[category]/page.tsx | 11 ++++------- apps/masterbots.ai/app/(browse)/page.tsx | 8 ++++---- apps/masterbots.ai/app/b/[id]/page.tsx | 8 ++++---- apps/masterbots.ai/app/u/[slug]/page.tsx | 8 ++++---- .../browse-input.tsx} | 2 +- .../category-tabs/category-link.tsx} | 2 +- .../category-tabs/category-tabs.tsx} | 8 ++++---- .../components/shared/category-tabs/index.ts | 1 + .../{routes/browse => shared}/shortlink-button.tsx | 0 10 files changed, 28 insertions(+), 30 deletions(-) rename apps/masterbots.ai/components/{routes/browse/browse-search-input.tsx => shared/browse-input.tsx} (97%) rename apps/masterbots.ai/components/{routes/browse/browse-category-link.tsx => shared/category-tabs/category-link.tsx} (97%) rename apps/masterbots.ai/components/{routes/browse/browse-category-tabs.tsx => shared/category-tabs/category-tabs.tsx} (91%) create mode 100644 apps/masterbots.ai/components/shared/category-tabs/index.ts rename apps/masterbots.ai/components/{routes/browse => shared}/shortlink-button.tsx (100%) diff --git a/apps/masterbots.ai/app/(browse)/[category]/[threadId]/page.tsx b/apps/masterbots.ai/app/(browse)/[category]/[threadId]/page.tsx index c6e988b1..bd44bb9b 100644 --- a/apps/masterbots.ai/app/(browse)/[category]/[threadId]/page.tsx +++ b/apps/masterbots.ai/app/(browse)/[category]/[threadId]/page.tsx @@ -1,10 +1,10 @@ import { getCategories, getMessagePairs, getThread } from '@/services/hasura' import type { ChatPageProps } from '@/app/c/[chatbot]/[threadId]/page' -import Shortlink from '@/components/routes/browse/shortlink-button' +import Shortlink from '@/components/shared/shortlink-button' import { ThreadAccordion } from '@/components/shared/thread-accordion' -import { BrowseCategoryTabs } from '@/components/routes/browse/browse-category-tabs' -import { BrowseSearchInput } from '@/components/routes/browse/browse-search-input' +import { CategoryTabs } from '@/components/shared/category-tabs/category-tabs' +import { BrowseInput } from '@/components/shared/browse-input' export default async function ThreadLandingPage({ params }: ChatPageProps) { const categories = await getCategories() @@ -15,8 +15,8 @@ export default async function ThreadLandingPage({ params }: ChatPageProps) { return (
- - + + - - + +
) diff --git a/apps/masterbots.ai/app/(browse)/page.tsx b/apps/masterbots.ai/app/(browse)/page.tsx index 1511a84e..9c39ccbf 100644 --- a/apps/masterbots.ai/app/(browse)/page.tsx +++ b/apps/masterbots.ai/app/(browse)/page.tsx @@ -1,6 +1,6 @@ import ThreadList from '@/components/shared/thread-list' -import { BrowseCategoryTabs } from '@/components/routes/browse/browse-category-tabs' -import { BrowseSearchInput } from '@/components/routes/browse/browse-search-input' +import { CategoryTabs } from '@/components/shared/category-tabs/category-tabs' +import { BrowseInput } from '@/components/shared/browse-input' import { getBrowseThreads, getCategories } from '@/services/hasura' export default async function BrowsePage() { @@ -10,8 +10,8 @@ export default async function BrowsePage() { }) return (
- - + +
) diff --git a/apps/masterbots.ai/app/b/[id]/page.tsx b/apps/masterbots.ai/app/b/[id]/page.tsx index 1bbc32ec..e9fc5ccd 100644 --- a/apps/masterbots.ai/app/b/[id]/page.tsx +++ b/apps/masterbots.ai/app/b/[id]/page.tsx @@ -2,8 +2,8 @@ import { getChatbot, getBrowseThreads, getCategories } from '@/services/hasura' import { botNames } from '@/lib/bots-names' import ThreadList from '@/components/shared/thread-list' import AccountDetails from '@/components/shared/account-details' -import { BrowseCategoryTabs } from '@/components/routes/browse/browse-category-tabs' -import { BrowseSearchInput } from '@/components/routes/browse/browse-search-input' +import { CategoryTabs } from '@/components/shared/category-tabs/category-tabs' +import { BrowseInput } from '@/components/shared/browse-input' export default async function BotThreadsPage({ params @@ -27,8 +27,8 @@ export default async function BotThreadsPage({ return (
- - + + - - + + diff --git a/apps/masterbots.ai/components/routes/browse/browse-category-link.tsx b/apps/masterbots.ai/components/shared/category-tabs/category-link.tsx similarity index 97% rename from apps/masterbots.ai/components/routes/browse/browse-category-link.tsx rename to apps/masterbots.ai/components/shared/category-tabs/category-link.tsx index 21b3c0f3..f5969b4a 100644 --- a/apps/masterbots.ai/components/routes/browse/browse-category-link.tsx +++ b/apps/masterbots.ai/components/shared/category-tabs/category-link.tsx @@ -2,7 +2,7 @@ import { motion } from 'framer-motion' import type { Category } from '@repo/mb-genql' import Link from 'next/link' -export function BrowseCategoryLink({ +export function CategoryLink({ category, activeTab, onClick, diff --git a/apps/masterbots.ai/components/routes/browse/browse-category-tabs.tsx b/apps/masterbots.ai/components/shared/category-tabs/category-tabs.tsx similarity index 91% rename from apps/masterbots.ai/components/routes/browse/browse-category-tabs.tsx rename to apps/masterbots.ai/components/shared/category-tabs/category-tabs.tsx index 348c1d4b..0c7c8d6f 100644 --- a/apps/masterbots.ai/components/routes/browse/browse-category-tabs.tsx +++ b/apps/masterbots.ai/components/shared/category-tabs/category-tabs.tsx @@ -3,9 +3,9 @@ import type { Category } from '@repo/mb-genql' import { useEffect } from 'react' import { useBrowse } from '@/hooks/use-browse' -import { BrowseCategoryLink } from './browse-category-link' +import { CategoryLink } from './category-link' -export function BrowseCategoryTabs({ +export function CategoryTabs({ categories, initialCategory = 'all' }: { @@ -46,7 +46,7 @@ export function BrowseCategoryTabs({ return (
- {categories.map((category, key) => ( -