diff --git a/app/(auth)/sign-in/page.tsx b/app/(auth)/sign-in/page.tsx deleted file mode 100644 index f2000a8..0000000 --- a/app/(auth)/sign-in/page.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import { LoginLink } from "@kinde-oss/kinde-auth-nextjs/components"; -import { Container } from "@/components/templates/container"; -import { Button } from "@/components/atoms/button"; -import Link from "next/link"; - -export default function SignIn() { - return ( - - - Sign in - - - - {`Continue with Google`} - - - - {"Don't have an account? "}{" "} - - Sign up! - - - - - - ); -} diff --git a/app/(auth)/sign-up/page.tsx b/app/(auth)/sign-up/page.tsx deleted file mode 100644 index 5543a31..0000000 --- a/app/(auth)/sign-up/page.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import { RegisterLink } from "@kinde-oss/kinde-auth-nextjs/components"; -import { Container } from "@/components/templates/container"; -import { Button } from "@/components/atoms/button"; -import Link from "next/link"; - -export default function SignUp() { - return ( - - - Sign up - - - - {`Continue with Google`} - - - - {"Already have an account? "}{" "} - - Sign in! - - - - - - ); -} diff --git a/app/(main)/components/heroSection/heroSection.tsx b/app/(main)/components/heroSection/heroSection.tsx index d8a259c..f339a47 100644 --- a/app/(main)/components/heroSection/heroSection.tsx +++ b/app/(main)/components/heroSection/heroSection.tsx @@ -1,11 +1,16 @@ +import React from "react"; import Image from "next/image"; -import { SplitContainer } from "@/components/templates/container"; +import { RegisterLink } from "@kinde-oss/kinde-auth-nextjs/components"; import { barber } from "@/public/illustrations"; -import React from "react"; +import { SplitContainer } from "@/components/templates/container"; import { Button } from "@/components/atoms/button"; +import { getKindeServerSession } from "@kinde-oss/kinde-auth-nextjs/server"; import Link from "next/link"; -const HeroSection = () => { +async function HeroSection() { + const { isAuthenticated } = getKindeServerSession(); + const isSignedIn = await isAuthenticated(); + return ( @@ -31,14 +36,25 @@ const HeroSection = () => { className="w-full animate-fade-in" style={{ "--index": 1 } as React.CSSProperties} > - - Get started! + + {isSignedIn ? ( + Book your next appointment + ) : ( + + Get started! + + )} ); -}; +} export default HeroSection; diff --git a/app/(main)/components/heroSection/hero.stories.tsx b/archive/hero.stories.tsx similarity index 58% rename from app/(main)/components/heroSection/hero.stories.tsx rename to archive/hero.stories.tsx index 4ccc092..a0c5c4c 100644 --- a/app/(main)/components/heroSection/hero.stories.tsx +++ b/archive/hero.stories.tsx @@ -1,5 +1,5 @@ import { Meta, StoryObj } from "@storybook/react"; -import HeroSection from "./heroSection"; +import HeroSection from "../app/(main)/components/heroSection/heroSection"; const meta: Meta = { title: "Pages/Home/HeroSection", @@ -11,9 +11,15 @@ const meta: Meta = { }, layout: "fullscreen", }, + /** Disabling the test since current version of storybook does not support dynamic server components. + * This should be fixed in version 8. + */ + tags: ["no-tests"], }; export default meta; type Story = StoryObj; -export const Default: Story = {}; +export const Default: Story = { + render: () => , +}; diff --git a/app/(main)/home.stories.tsx b/archive/home.stories.tsx similarity index 68% rename from app/(main)/home.stories.tsx rename to archive/home.stories.tsx index 71da7d2..4d61f27 100644 --- a/app/(main)/home.stories.tsx +++ b/archive/home.stories.tsx @@ -1,5 +1,5 @@ import { Meta, StoryObj } from "@storybook/react"; -import Home from "./page"; +import Home from "../app/(main)/page"; const meta: Meta = { title: "Pages/Home", @@ -11,6 +11,10 @@ const meta: Meta = { }, layout: "fullscreen", }, + /** Disabling the test since current version of storybook does not support dynamic server components. + * This should be fixed in version 8. + */ + tags: ["no-tests"], }; export default meta; diff --git a/components/organisms/header/header.tsx b/components/organisms/header/header.tsx index 7d35b11..866a3dd 100644 --- a/components/organisms/header/header.tsx +++ b/components/organisms/header/header.tsx @@ -1,7 +1,7 @@ "use client"; import React, { useEffect, useState } from "react"; -import { LogoutLink } from "@kinde-oss/kinde-auth-nextjs/components"; +import { LoginLink, LogoutLink } from "@kinde-oss/kinde-auth-nextjs/components"; import { CalendarIcon, LogOutIcon } from "lucide-react"; import { Container } from "@/components/templates/container"; import { Button } from "@/components/atoms/button"; @@ -58,7 +58,6 @@ function Header({ photo, isAuthenticated }: HeaderProps) { @@ -86,7 +85,15 @@ function Header({ photo, isAuthenticated }: HeaderProps) { ) : ( - Sign in + + {"Sign in"} + )}