Skip to content

Commit

Permalink
feat: global categories nav
Browse files Browse the repository at this point in the history
  • Loading branch information
gaboesquivel committed Apr 8, 2024
1 parent a103a90 commit 090356b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apps/masterbots.ai/app/(browse)/[category]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default async function BrowseCategoryPage({
})

return (
<div className="w-full container pb-10 mx-auto">
<div className="container">
<BrowseCategoryTabs
categories={categories}
initialCategory={params.category}
Expand Down
2 changes: 1 addition & 1 deletion apps/masterbots.ai/app/(browse)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default async function BrowsePage() {
limit: 50
})
return (
<div className="w-full container px-4 pb-10 mx-auto">
<div className="container">
<BrowseCategoryTabs categories={categories} />
<BrowseSearchInput />
<ThreadList initialThreads={threads} filter={{}} />
Expand Down
9 changes: 7 additions & 2 deletions apps/masterbots.ai/app/b/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import { getChatbot, getBrowseThreads } from '@/services/hasura'
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'

export default async function BotThreadsPage({
params
}: {
params: { id: string }
}) {
const categories = await getCategories()
let chatbot, threads

chatbot = await getChatbot({
Expand All @@ -23,7 +26,9 @@ export default async function BotThreadsPage({
})

return (
<div className="w-full py-5">
<div className=" container">
<BrowseCategoryTabs categories={categories} />
<BrowseSearchInput />
<AccountDetails
href={`/b/${chatbot.name.toLowerCase()}`}
alt={chatbot.name}
Expand Down
13 changes: 11 additions & 2 deletions apps/masterbots.ai/app/u/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
import { getBrowseThreads, getUserInfoFromBrowse } from '@/services/hasura'
import {
getBrowseThreads,
getCategories,
getUserInfoFromBrowse
} from '@/services/hasura'
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'

export default async function BotThreadsPage({
params
}: {
params: { slug: string }
}) {
const categories = await getCategories()
const user = await getUserInfoFromBrowse(params.slug)
if (!user) return <div className="m-auto">No user found.</div>
const threads = await getBrowseThreads({
slug: params.slug,
limit: 50
})
return (
<div className="w-full py-5">
<div className="container">
<BrowseCategoryTabs categories={categories} />
<BrowseSearchInput />
<AccountDetails
href={`/u/${params.slug}`}
alt={user.username}
Expand Down

0 comments on commit 090356b

Please sign in to comment.