el.xwx.moe/layouts/CenteredForm.tsx

60 lines
1.7 KiB
TypeScript
Raw Normal View History

2023-08-15 20:29:38 -05:00
import { useTheme } from "next-themes";
2023-08-01 15:20:05 -05:00
import Image from "next/image";
2023-08-15 20:29:38 -05:00
import Link from "next/link";
2023-08-01 15:20:05 -05:00
import React, { ReactNode } from "react";
interface Props {
text?: string;
children: ReactNode;
}
export default function CenteredForm({ text, children }: Props) {
2023-08-15 20:29:38 -05:00
const { theme } = useTheme();
2023-08-01 15:20:05 -05:00
return (
2023-08-15 20:29:38 -05:00
<div className="absolute top-0 bottom-0 left-0 right-0 flex justify-center items-center p-5">
<div className="m-auto flex flex-col gap-2 w-full">
{theme ? (
<Image
src={`/linkwarden_${theme === "dark" ? "dark" : "light"}.png`}
width={640}
height={136}
alt="Linkwarden"
className="h-12 w-fit mx-auto"
/>
) : undefined}
{/* {theme === "dark" ? (
2023-08-15 20:29:38 -05:00
<Image
2023-09-26 16:54:25 -05:00
src="/linkwarden_dark.png"
2023-09-26 01:39:23 -05:00
width={640}
height={136}
2023-08-15 20:29:38 -05:00
alt="Linkwarden"
className="h-12 w-fit mx-auto"
/>
) : (
<Image
2023-09-26 01:39:23 -05:00
src="/linkwarden_light.png"
width={640}
height={136}
2023-08-15 20:29:38 -05:00
alt="Linkwarden"
className="h-12 w-fit mx-auto"
/>
)} */}
2023-08-01 15:20:05 -05:00
{text ? (
<p className="text-lg max-w-[30rem] min-w-80 w-full mx-auto font-semibold text-black dark:text-white px-2 text-center">
2023-08-01 15:20:05 -05:00
{text}
</p>
) : undefined}
{children}
2023-08-15 20:29:38 -05:00
<p className="text-center text-xs text-gray-500 mb-5 dark:text-gray-400">
© {new Date().getFullYear()}{" "}
<Link href="https://linkwarden.app" className="font-semibold">
Linkwarden
</Link>
. All rights reserved.
2023-08-01 15:20:05 -05:00
</p>
</div>
</div>
);
}