add admin mode bar on top of page
This commit is contained in:
parent
e6fdbf714d
commit
a69e32ee11
20
src/components/admin/ControlBar.tsx
Normal file
20
src/components/admin/ControlBar.tsx
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
const AdminBarLayout = ({
|
||||||
|
actions,
|
||||||
|
children,
|
||||||
|
}: {
|
||||||
|
actions: JSX.Element | JSX.Element[];
|
||||||
|
children: JSX.Element | JSX.Element[];
|
||||||
|
}) => {
|
||||||
|
return (
|
||||||
|
<div className="relative">
|
||||||
|
<div className="sticky left-0 right-0 top-[71px] z-10 mx-auto mb-8 mt-[15px] flex max-w-4xl flex-row rounded-xl border border-neutral-600 bg-red-300 drop-shadow-xl">
|
||||||
|
<h1 className="rounded-lg px-4 py-2 font-semibold text-black">
|
||||||
|
Admin Mode
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export { AdminBarLayout };
|
@ -10,6 +10,7 @@ import Image from "next/image";
|
|||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import Footer from "~/components/Footer";
|
import Footer from "~/components/Footer";
|
||||||
import Header from "~/components/Header";
|
import Header from "~/components/Header";
|
||||||
|
import { AdminBarLayout } from "~/components/admin/ControlBar";
|
||||||
|
|
||||||
export const getStaticPaths = async () => {
|
export const getStaticPaths = async () => {
|
||||||
const resources = await prisma.auditoryResource.findMany({
|
const resources = await prisma.auditoryResource.findMany({
|
||||||
@ -133,35 +134,37 @@ const ResourceViewPage = (
|
|||||||
<>
|
<>
|
||||||
<div className="min-h-screen">
|
<div className="min-h-screen">
|
||||||
<Header />
|
<Header />
|
||||||
<main className="mb-12">
|
<AdminBarLayout>
|
||||||
<div className="mx-auto flex max-w-2xl flex-col flex-col-reverse divide-x py-4 sm:flex-row">
|
<main className="mb-12">
|
||||||
<div className="my-5 mr-4 flex flex-col justify-end text-lg font-bold">
|
<div className="mx-auto flex max-w-2xl flex-col flex-col-reverse divide-x py-4 sm:flex-row">
|
||||||
<div className="mx-4">
|
<div className="my-5 mr-4 flex flex-col justify-end text-lg font-bold">
|
||||||
<h1 className="mb-2 border-b border-neutral-400">Links</h1>
|
<div className="mx-4">
|
||||||
<DownloadButtons
|
<h1 className="mb-2 border-b border-neutral-400">Links</h1>
|
||||||
platformLinks={resourceQuery.data.platform_links}
|
<DownloadButtons
|
||||||
/>
|
platformLinks={resourceQuery.data.platform_links}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="justify-left flex flex-col pb-5">
|
||||||
|
<ResourceInfo resource={resourceQuery.data} />
|
||||||
|
<div className="mx-4 overflow-hidden rounded-xl border border-neutral-400 bg-neutral-200 text-left shadow">
|
||||||
|
<ResourceDescription
|
||||||
|
manufacturer={resourceQuery.data.manufacturer}
|
||||||
|
description={resourceQuery.data.description}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="ml-4 mr-auto mt-4 rounded-lg border-2 border-neutral-900 bg-neutral-600">
|
||||||
|
<span className="px-2 py-2 text-sm text-neutral-200">
|
||||||
|
Ages {resourceQuery.data.ages.min}
|
||||||
|
{resourceQuery.data.ages.max >= 100
|
||||||
|
? "+"
|
||||||
|
: `-${resourceQuery.data.ages.max}`}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="justify-left flex flex-col pb-5">
|
</main>
|
||||||
<ResourceInfo resource={resourceQuery.data} />
|
</AdminBarLayout>
|
||||||
<div className="mx-4 overflow-hidden rounded-xl border border-neutral-400 bg-neutral-200 text-left shadow">
|
|
||||||
<ResourceDescription
|
|
||||||
manufacturer={resourceQuery.data.manufacturer}
|
|
||||||
description={resourceQuery.data.description}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="ml-4 mr-auto mt-4 rounded-lg border-2 border-neutral-900 bg-neutral-600">
|
|
||||||
<span className="px-2 py-2 text-sm text-neutral-200">
|
|
||||||
Ages {resourceQuery.data.ages.min}
|
|
||||||
{resourceQuery.data.ages.max >= 100
|
|
||||||
? "+"
|
|
||||||
: `-${resourceQuery.data.ages.max}`}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
<Footer />
|
<Footer />
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user