Connect, collaborate, and grow with a community of TypeScript developers
fix: make "view more" button on /explore an actual link instead of button with onClick (#1330)
Alex Ozerovbafb04f56cb0
diff --git a/apps/web/src/app/[locale]/explore/_components/view-more-button.tsx b/apps/web/src/app/[locale]/explore/_components/view-more-button.tsxindex 03fedfd0..deda905e 100644--- a/apps/web/src/app/[locale]/explore/_components/view-more-button.tsx+++ b/apps/web/src/app/[locale]/explore/_components/view-more-button.tsx@@ -1,8 +1,6 @@-'use client';-import { Button } from '@repo/ui/components/button';import { ChevronRight } from '@repo/ui/icons';-import { useRouter } from 'next/navigation';+import Link from 'next/link';export const BUTTON_BY_TAGS = {POPULAR:@@ -28,18 +26,17 @@ interface ViewMoreButtonProps {}export function ViewMoreButton({ redirectRoute, tag }: ViewMoreButtonProps) {- const router = useRouter();return (<Button+ asChildclassName={`group items-center whitespace-nowrap rounded-full py-2 pl-4 pr-3 backdrop-blur-sm${BUTTON_BY_TAGS[tag]}`}- onClick={() => {- router.push(redirectRoute);- }}variant="ghost">- view more- <ChevronRight className="ml-2 h-4 w-4 stroke-[3] duration-300 group-hover:translate-x-1" />+ <Link href={redirectRoute}>+ view more+ <ChevronRight className="ml-2 h-4 w-4 stroke-[3] duration-300 group-hover:translate-x-1" />+ </Link></Button>);}