Polish admin hub pages: drop duplicate headers, align CTAs and empties.
Remove redundant titles under AdminHubChrome, style events/polls create flows with admin chrome + i18n, and standardize empty states / teams form classes. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
1 parent
0582eed5ab
commit
3cb8b92cb3
14 files changed
+112
-105
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { redirect } from "next/navigation";
|
||||
import { canAccess, getAdminContext, PERMS } from "@/lib/permissions";
|
||||
import { prisma } from "@/lib/prisma";
|
||||
@@ -9,6 +10,7 @@ export default async function CreateEventPage() {
|
||||
redirect("/admin/events");
|
||||
}
|
||||
|
||||
const t = await getTranslations("pages.admin.events");
|
||||
const eventTypes = await prisma.websiteEventType.findMany({
|
||||
where: { isActive: 1 },
|
||||
orderBy: { name: "asc" },
|
||||
@@ -17,8 +19,12 @@ export default async function CreateEventPage() {
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
<div>
|
||||
<h1 className="text-3xl font-bold tracking-tight">Create Event</h1>
|
||||
<p className="text-muted-foreground">Schedule a new hotel event</p>
|
||||
<h1 className="m-0 text-2xl font-extrabold text-[var(--admin-text)]">
|
||||
{t("createTitle")}
|
||||
</h1>
|
||||
<p className="m-0 mt-1 text-sm text-[var(--admin-text-muted)]">
|
||||
{t("createSubtitle")}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<EventForm eventTypes={eventTypes} />
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Link from "next/link";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { fetchAdminList } from "@/lib/admin-list";
|
||||
import { PERMS } from "@/lib/permissions";
|
||||
import { EventsTable } from "./events-table";
|
||||
@@ -11,6 +11,7 @@ export default async function EventsPage({
|
||||
params: Promise<{ locale: string }>;
|
||||
searchParams: Promise<Record<string, string>>;
|
||||
}) {
|
||||
const t = await getTranslations("pages.admin.events");
|
||||
const result = await fetchAdminList(
|
||||
{
|
||||
permission: PERMS.EVENTS_VIEW,
|
||||
@@ -45,9 +46,9 @@ export default async function EventsPage({
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
<div className="flex justify-end">
|
||||
<Button asChild>
|
||||
<Link href="/admin/events/create">New Event</Link>
|
||||
</Button>
|
||||
<Link href="/admin/events/create" className="btn btn-primary">
|
||||
{t("newEvent")}
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
<EventsTable
|
||||
|
||||
Reference in new issue
Block a user