diff --git a/src/app/(unauthenticated)/(landing)/_components/hero.tsx b/src/app/(unauthenticated)/(landing)/_components/hero.tsx index 9131488..a371c73 100644 --- a/src/app/(unauthenticated)/(landing)/_components/hero.tsx +++ b/src/app/(unauthenticated)/(landing)/_components/hero.tsx @@ -1,16 +1,87 @@ +'use client'; + import React from 'react'; +import Link from 'next/link'; + +import { api } from '@/convex/_generated/api'; +import { useQuery } from 'convex/react'; + export default function Hero() { + const portfolios = useQuery(api.portfolios.getAllPortfolios); + const numberOfPortfolios = portfolios?.length; + return ( <> -
+
+
+
+ + + Introducing Portfolio Templates + + + + + +
+
+ +

- Discover portfolios to inspire your creativity + Discover{' '} + + portfolios + + + + + + + + + + {' '} + to inspire your creativity

- Browse our curated collection of exceptional designs to help you create - your best portfolio yet. + Browse our curated collection of{' '} + {numberOfPortfolios && ( + + {numberOfPortfolios}+ + + )}{' '} + exceptional designs to help you create your best portfolio yet.

); diff --git a/src/app/(unauthenticated)/portfolio/[id]/page.tsx b/src/app/(unauthenticated)/portfolio/[id]/page.tsx index 39b5ec4..10edd04 100644 --- a/src/app/(unauthenticated)/portfolio/[id]/page.tsx +++ b/src/app/(unauthenticated)/portfolio/[id]/page.tsx @@ -16,7 +16,7 @@ import { getImageUrl } from '@/lib/get-image-url'; import { cn } from '@/lib/utils'; import { SignInButton } from '@clerk/nextjs'; import { useMutation, useQuery } from 'convex/react'; -import { ChevronLeft, ExternalLink, Heart } from 'lucide-react'; +import { ExternalLink, Heart } from 'lucide-react'; export default function PortfolioPage({ params }: { params: { id: string } }) { const { id } = params; @@ -92,11 +92,15 @@ export default function PortfolioPage({ params }: { params: { id: string } }) { )}
- {portfolio.favoritesCount && ( -
- {portfolio.favoritesCount ?? '0'} likes -
- )} + {portfolio.favoritesCount !== undefined && + portfolio.favoritesCount !== null && ( +
+ {portfolio.favoritesCount === 0 && '0 likes'} + {portfolio.favoritesCount === 1 && '1 like'} + {portfolio.favoritesCount > 1 && + `${portfolio.favoritesCount} likes`} +
+ )}
{/* Socials */} @@ -157,14 +161,14 @@ export default function PortfolioPage({ params }: { params: { id: string } }) {
diff --git a/tailwind.config.ts b/tailwind.config.ts index 9afdafd..f3e88d9 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -65,11 +65,16 @@ module.exports = { backgroundPosition: 'var(--bg-size) 0', }, }, + gradientBorder: { + '0%, 100%': { backgroundPosition: '0% 50%' }, + '50%': { backgroundPosition: '100% 50%' }, + }, }, animation: { 'accordion-down': 'accordion-down 0.2s ease-out', 'accordion-up': 'accordion-up 0.2s ease-out', gradient: 'gradient 8s linear infinite', + 'gradient-border': 'gradientBorder 3s ease infinite', }, }, },