From 8f3531148e422ef5885c923a91a3080db20d86cf Mon Sep 17 00:00:00 2001 From: eduamdev <35645733+eduamdev@users.noreply.github.com> Date: Sun, 11 Aug 2024 22:13:33 -0600 Subject: [PATCH] Upgrade @clerk/nextjs to the latest version and refactor code for compatibility --- .env.example | 4 +- app/(auth)/sign-in/[[...sign-in]]/page.tsx | 2 +- app/(auth)/sign-up/[[...sign-up]]/page.tsx | 2 +- app/components/site-header.tsx | 35 +- app/components/ui/scroll-area.tsx | 4 +- app/components/ui/select.tsx | 2 +- app/globals.css | 6 - app/layout.tsx | 18 +- .../[[...rest]]}/page.tsx | 8 +- .../reservation/components/navigate-back.tsx | 0 .../reservation/lib/dates.ts | 0 middleware.ts | 20 +- package.json | 2 +- pnpm-lock.yaml | 412 ++++-------------- 14 files changed, 114 insertions(+), 401 deletions(-) rename app/{(reservation)/reservation => reservation/[[...rest]]}/page.tsx (97%) rename app/{(reservation) => }/reservation/components/navigate-back.tsx (100%) rename app/{(reservation) => }/reservation/lib/dates.ts (100%) diff --git a/.env.example b/.env.example index 1e4f81a..bfa4bda 100644 --- a/.env.example +++ b/.env.example @@ -8,4 +8,6 @@ POSTGRES_PASSWORD="" POSTGRES_DATABASE="" NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME="" NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY="" -CLERK_SECRET_KEY="" \ No newline at end of file +CLERK_SECRET_KEY="" +NEXT_PUBLIC_CLERK_SIGN_IN_URL="/sign-in" +NEXT_PUBLIC_CLERK_SIGN_UP_URL="/sign-up" \ No newline at end of file diff --git a/app/(auth)/sign-in/[[...sign-in]]/page.tsx b/app/(auth)/sign-in/[[...sign-in]]/page.tsx index 1b561f1..8795d64 100644 --- a/app/(auth)/sign-in/[[...sign-in]]/page.tsx +++ b/app/(auth)/sign-in/[[...sign-in]]/page.tsx @@ -3,7 +3,7 @@ import { SignIn } from '@clerk/nextjs'; export default function Page() { return (
- +
); } diff --git a/app/(auth)/sign-up/[[...sign-up]]/page.tsx b/app/(auth)/sign-up/[[...sign-up]]/page.tsx index 37df7ed..89e6ee4 100644 --- a/app/(auth)/sign-up/[[...sign-up]]/page.tsx +++ b/app/(auth)/sign-up/[[...sign-up]]/page.tsx @@ -3,7 +3,7 @@ import { SignUp } from '@clerk/nextjs'; export default function Page() { return (
- +
); } diff --git a/app/components/site-header.tsx b/app/components/site-header.tsx index 149f37d..b0668d9 100644 --- a/app/components/site-header.tsx +++ b/app/components/site-header.tsx @@ -1,5 +1,11 @@ import Link from 'next/link'; -import { UserButton, SignedIn, SignedOut } from '@clerk/nextjs'; +import { + UserButton, + SignedIn, + SignedOut, + SignInButton, + SignUpButton, +} from '@clerk/nextjs'; import { Popover, PopoverContent, @@ -13,19 +19,14 @@ export function SiteHeader() { - + ); } diff --git a/app/components/ui/scroll-area.tsx b/app/components/ui/scroll-area.tsx index 24bf58a..486bda6 100644 --- a/app/components/ui/scroll-area.tsx +++ b/app/components/ui/scroll-area.tsx @@ -33,9 +33,9 @@ const ScrollBar = React.forwardRef< className={cn( 'flex touch-none select-none transition-colors', orientation === 'vertical' && - 'h-full w-2.5 border-l border-l-transparent p-[1px]', + 'h-full w-2.5 border-l border-l-transparent p-px', orientation === 'horizontal' && - 'h-2.5 border-t border-t-transparent p-[1px]', + 'h-2.5 border-t border-t-transparent p-px', className, )} {...props} diff --git a/app/components/ui/select.tsx b/app/components/ui/select.tsx index 092c7e3..0bbb5b6 100644 --- a/app/components/ui/select.tsx +++ b/app/components/ui/select.tsx @@ -40,7 +40,7 @@ const SelectContent = React.forwardRef< +
{children}
diff --git a/app/(reservation)/reservation/page.tsx b/app/reservation/[[...rest]]/page.tsx similarity index 97% rename from app/(reservation)/reservation/page.tsx rename to app/reservation/[[...rest]]/page.tsx index c47b331..06ba38f 100644 --- a/app/(reservation)/reservation/page.tsx +++ b/app/reservation/[[...rest]]/page.tsx @@ -5,10 +5,10 @@ import { Button } from '@/app/components/ui/button'; import { Separator } from '@/app/components/ui/separator'; import { siteConfig } from '@/config/site'; import { formatCurrency } from '@/app/lib/utils'; -import { NavigateBack } from './components/navigate-back'; +import { NavigateBack } from '../components/navigate-back'; import { SearchParams } from '@/app/lib/types'; import { getCarBySlug, getLocationBySlug } from '@/db/queries'; -import { formatDates } from './lib/dates'; +import { formatDates } from '../lib/dates'; import { differenceInDays } from 'date-fns'; import { SignIn, SignedIn, SignedOut } from '@clerk/nextjs'; @@ -100,7 +100,7 @@ export default async function ReservationPage({
- +