openstock/app/(auth)/layout.tsx

51 lines
2.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import Link from "next/link";
import React from "react";
import Image from "next/image";
import {headers} from "next/headers";
import {redirect} from "next/navigation";
import {auth} from "@/lib/better-auth/auth";
const Layout = async ({ children }: { children : React.ReactNode }) => {
const session = await auth.api.getSession({headers: await headers()});
if (session?.user) redirect('/')
return (
<main className="auth-layout">
<section className="auth-left-section scrollbar-hide-default">
<Link href="/" className="auth-logo flex items-center gap-2">
<Image src="/assets/images/logo.png" alt="" width={30} height={30}/>
<h2 className="text-3xl font-bold text-white">OpenStock</h2>
</Link>
<div className="pb-6 lg:pb-8 flex-1">
{children}
</div>
</section>
<section className="auth-right-section">
<div className="z-10 relative lg:mt-4 lg:mb-16">
<blockquote className="auth-blockquote">
For me, OpenStock isnt just another stock app. Its about giving people clarity and control in the market, without barriers or subscriptions.
</blockquote>
<div className="flex items-center justify-between">
<div>
<cite className="auth-testimonial-author">- Ravi Pratap Singh (@ravixalgorithm)</cite>
<p className="max-md:text-xs text-gray-500">Founder @opendevsociety</p>
</div>
<div className="flex items-center gap-0.5">
{[1,2,3,4,5].map((star) => (
<Image src="/assets/icons/star.svg" alt="star" key={star} width={20} height={20} className="w-4 h-4"/>
))}
</div>
</div>
</div>
<div className="flex-1 relative">
<Image src="/assets/images/dashboard.png" alt="Dashboard Preview" width={1440} height={1150} className="auth-dashboard-preview absolute top-0" />
</div>
</section>
</main>
)
}
export default Layout