Skip to content

Commit

Permalink
chore: 404 page
Browse files Browse the repository at this point in the history
  • Loading branch information
gaboesquivel committed Apr 11, 2024
1 parent dc71d02 commit 3f841fb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
5 changes: 5 additions & 0 deletions apps/masterbots.ai/app/404/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default async function NotFoudPage() {
return (
<div className="max-w-[1024px] pb-10 mx-auto w-full mt-10">NOT Found</div>
)
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { motion } from 'framer-motion'
import type { Category } from '@repo/mb-genql'
import Link from 'next/link'
import { toSlug } from '@repo/mb-lib'

export function CategoryLink({
category,
Expand All @@ -16,11 +17,7 @@ export function CategoryLink({
? 'dark:text-white'
: 'dark:hover:text-white dark:text-[#F4F4F580] text-zinc-500 hover:text-black'
} relative rounded-full px-3 py-1.5 text-sm font-medium outline-sky-400 transition focus-visible:outline-2`}
href={
category === 'all'
? '/'
: `/${category.name.toLowerCase().replace(/\s+/g, '_').replace(/\&/g, '_')}`
}
href={category === 'all' ? '/' : `/${toSlug(category.name)}`}
id={id}
shallow
style={{
Expand Down
5 changes: 2 additions & 3 deletions apps/masterbots.ai/components/shared/thread-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function ThreadList({
const searchParams = useSearchParams()
const queryKey = [usePathname() + searchParams.get('query')]
const loadMoreRef = useRef<HTMLDivElement>(null)
const threads = useQuery<Thread[]>({
const threads = useQuery({
queryKey,
queryFn: async () => {
const searchFilter = {
Expand Down Expand Up @@ -58,15 +58,14 @@ export function ThreadList({
// ThreadDialog and ThreadDoubleAccordion can be used interchangeably
const ThreadComponent = dialog ? ThreadDialog : ThreadDoubleAccordion

console.log('ThreadList', queryKey)
return (
<div
// use url queryKey as key for component to force rerender
// I'm debuggin ssr results hydration issues
key={queryKey[0]}
className="flex flex-col w-full gap-8 py-5"
>
{threads.map((thread: Thread, key) => (
{threads.data.map((thread: Thread, key) => (
<ThreadComponent
key={key}
thread={thread}
Expand Down

0 comments on commit 3f841fb

Please sign in to comment.