Finish Docs #38, show publicID on HUB
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { StatsToggle } from "(app)/_components/StatsToggle";
|
||||
import { StatsTitle, StatsToggle } from "(app)/_components/StatsToggle";
|
||||
|
||||
import { prisma } from "@repo/db";
|
||||
import { getServerSession } from "api/auth/[...nextauth]/auth";
|
||||
@@ -282,7 +282,7 @@ export const Stats = async ({ stats }: { stats: "pilot" | "dispo" }) => {
|
||||
|
||||
return (
|
||||
<>
|
||||
{session.user.permissions.includes("DISPO") && <StatsToggle />}
|
||||
{session.user.permissions.includes("DISPO") ? <StatsToggle /> : <StatsTitle />}
|
||||
<div className="card bg-base-200 shadow-xl mb-4 col-span-6 xl:col-span-3">
|
||||
{stats === "dispo" && <DispoStats />}
|
||||
{stats === "pilot" && <PilotStats />}
|
||||
|
||||
@@ -28,9 +28,12 @@ export const StatsToggle = () => {
|
||||
}, [checked, router]);
|
||||
|
||||
return (
|
||||
<header className="flex justify-between items-center p-4">
|
||||
<header className="flex justify-between items-center pb-4">
|
||||
<h1 className="text-2xl font-bold">
|
||||
Hallo, {session.status === "authenticated" ? session.data?.user.firstname : "<username>"}
|
||||
Hallo,{" "}
|
||||
{session.status === "authenticated"
|
||||
? session.data?.user.firstname + " <" + session.data?.user.publicId + ">"
|
||||
: "<username>"}
|
||||
{"!"}
|
||||
</h1>
|
||||
<div>
|
||||
@@ -49,3 +52,24 @@ export const StatsToggle = () => {
|
||||
</header>
|
||||
);
|
||||
};
|
||||
|
||||
export const StatsTitle = () => {
|
||||
const session = useSession();
|
||||
|
||||
return (
|
||||
<header className="flex justify-left items-center pb-4">
|
||||
<h1 className="text-2xl font-bold">
|
||||
Hallo,{" "}
|
||||
{session.status === "authenticated" ? (
|
||||
<>
|
||||
{session.data?.user.firstname}
|
||||
<span className="text-info text-xl">{" #" + session.data?.user.publicId}</span>
|
||||
</>
|
||||
) : (
|
||||
"<username>"
|
||||
)}
|
||||
{"!"}
|
||||
</h1>
|
||||
</header>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user