mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
www: add login on layout and fixes browse
This commit is contained in:
@@ -12,18 +12,16 @@ export default function UserInfo() {
|
||||
return !isAuthenticated ? (
|
||||
<span className="hover:underline focus-within:underline underline-offset-2 decoration-[.5px] font-light px-2">
|
||||
<Link href="/login" className="outline-none">
|
||||
Log in or create account
|
||||
Log in
|
||||
</Link>
|
||||
</span>
|
||||
) : (
|
||||
<span className="font-light px-2">
|
||||
{userinfo?.email} (
|
||||
<span className="hover:underline focus-within:underline underline-offset-2 decoration-[.5px]">
|
||||
<Link href="/logout" className="outline-none">
|
||||
Log out
|
||||
</Link>
|
||||
</span>
|
||||
)
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -57,20 +57,27 @@ export default function TranscriptBrowser() {
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div /** center and max 900px wide */ className="mx-auto max-w-[900px]">
|
||||
<div className="grid grid-cols-1 gap-2 lg:gap-4 h-full">
|
||||
{isLoading ? (
|
||||
{isLoading && (
|
||||
<div className="full-screen flex flex-col items-center justify-center">
|
||||
<FontAwesomeIcon
|
||||
icon={faGear}
|
||||
className="animate-spin-slow h-14 w-14 md:h-20 md:w-20"
|
||||
/>
|
||||
) : (
|
||||
<>
|
||||
{results === null ? (
|
||||
<div className="text-gray-500">No transcripts found.</div>
|
||||
</div>
|
||||
)}
|
||||
{!isLoading && !results ? (
|
||||
<div className="text-gray-500">
|
||||
No transcripts found, but you can
|
||||
<Link href="/transcripts/new" className="underline">
|
||||
record a meeting
|
||||
</Link>
|
||||
to get started.
|
||||
</div>
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
<div /** center and max 900px wide */ className="mx-auto max-w-[900px]">
|
||||
<div className="grid grid-cols-1 gap-2 lg:gap-4 h-full">
|
||||
{results?.items.map((item: GetTranscript) => (
|
||||
<div
|
||||
key={item.id}
|
||||
@@ -108,8 +115,6 @@ export default function TranscriptBrowser() {
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -9,7 +9,7 @@ import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import About from "./(aboutAndPrivacy)/about";
|
||||
import Privacy from "./(aboutAndPrivacy)/privacy";
|
||||
import { featPrivacy } from "./lib/utils";
|
||||
import { featPrivacy, featRequireLogin } from "./lib/utils";
|
||||
|
||||
const poppins = Poppins({ subsets: ["latin"], weight: ["200", "400", "600"] });
|
||||
|
||||
@@ -60,6 +60,7 @@ export const metadata: Metadata = {
|
||||
};
|
||||
|
||||
export default function RootLayout({ children }) {
|
||||
const requireLogin = featRequireLogin();
|
||||
return (
|
||||
<html lang="en">
|
||||
<body className={poppins.className + " h-screen relative"}>
|
||||
@@ -117,6 +118,14 @@ export default function RootLayout({ children }) {
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
{requireLogin ? (
|
||||
<>
|
||||
·
|
||||
<UserInfo />
|
||||
</>
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user