🐛 Disable quick create page when quick create is disabled (#1514)

This commit is contained in:
Luke Vella 2025-01-24 16:41:22 +00:00 committed by GitHub
parent a5b9edf5e6
commit 629d6ec7b7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4,14 +4,18 @@ import { LogInIcon } from "lucide-react";
import Link from "next/link";
import { notFound } from "next/navigation";
import { QuickCreateWidget } from "@/features/quick-create/quick-create-widget";
import { isSelfHosted } from "@/utils/constants";
import {
isQuickCreateEnabled,
QuickCreateWidget,
} from "@/features/quick-create";
import { getTranslation } from "@/i18n/server";
export default async function QuickCreatePage() {
if (isSelfHosted) {
// self hosted users should not see this page
if (!isQuickCreateEnabled) {
notFound();
}
const { t } = await getTranslation();
return (
<div className="flex min-h-screen p-2">
<div className="flex flex-1 flex-col gap-6 rounded-xl border bg-white p-6">
@ -28,7 +32,7 @@ export default async function QuickCreatePage() {
<Icon>
<LogInIcon />
</Icon>
Login
{t("login")}
</Link>
</Button>
</div>