This commit is contained in:
Luke Vella 2024-09-28 22:07:54 +01:00
parent 211e261c71
commit 8e778a40ec
No known key found for this signature in database
GPG key ID: 469CAD687F0D784C
9 changed files with 35 additions and 49 deletions

View file

@ -241,10 +241,8 @@
"verificationCodeSentTo": "We sent a verification code to <b>{email}</b>",
"home": "Home",
"groupPoll": "Group Poll",
"create": "Create",
"upcoming": "Upcoming",
"past": "Past",
"copyLink": "Copy Link",
"upcomingEventsEmptyStateTitle": "No Upcoming Events",
"upcomingEventsEmptyStateDescription": "When you schedule events, they will appear here.",
"pastEventsEmptyStateTitle": "No Past Events",
@ -281,5 +279,6 @@
"subscribe": "Subscribe",
"cancelAnytime": "Cancel anytime from your <a>billing page</a>.",
"copiedToClipboard": "Copied to clipboard",
"viewAll": "View All"
"viewAll": "View All",
"pending": "Pending"
}

View file

@ -1,9 +1,12 @@
import { CalendarIcon } from "lucide-react";
import { UserScheduledEvents } from "@/app/[locale]/(admin)/events/user-scheduled-events";
import { Params } from "@/app/[locale]/types";
import {
PageContainer,
PageContent,
PageHeader,
PageIcon,
PageTitle,
} from "@/app/components/page-layout";
import { getTranslation } from "@/app/i18n";
@ -13,13 +16,14 @@ export default async function Page({ params }: { params: Params }) {
return (
<PageContainer>
<PageHeader>
<div className="flex items-center gap-x-3">
<PageIcon>
<CalendarIcon />
</PageIcon>
<PageTitle>
{t("events", {
defaultValue: "Events",
})}
</PageTitle>
</div>
</PageHeader>
<PageContent>
<UserScheduledEvents />

View file

@ -7,6 +7,7 @@ import {
PageContainer,
PageContent,
PageHeader,
PageIcon,
PageTitle,
} from "@/app/components/page-layout";
import { getTranslation } from "@/app/i18n";
@ -17,6 +18,9 @@ export default async function Page({ params }: { params: Params }) {
<div>
<PageContainer>
<PageHeader>
<PageIcon>
<HomeIcon />
</PageIcon>
<PageTitle>
<Trans t={t} i18nKey="home" defaults="Home" />
</PageTitle>
@ -28,16 +32,3 @@ export default async function Page({ params }: { params: Params }) {
</div>
);
}
export async function generateMetadata({
params,
}: {
params: { locale: string };
}) {
const { t } = await getTranslation(params.locale);
return {
title: t("home", {
defaultValue: "Home",
}),
};
}

View file

@ -21,7 +21,6 @@ export default async function Page({
return (
<PageContainer>
<PageHeader>
<div className="flex items-center gap-x-3">
<PageIcon>
<BarChart2Icon />
</PageIcon>
@ -30,7 +29,6 @@ export default async function Page({
defaultValue: "Polls",
})}
</PageTitle>
</div>
</PageHeader>
<PageContent>
<UserPolls />

View file

@ -68,8 +68,8 @@ function FilteredPolls({ status }: { status: PollStatus }) {
status={poll.status}
inviteLink={`${window.location.origin}/invite/${poll.id}`}
responseCount={poll.participants.length}
dateStart={poll.createdAt}
dateEnd={poll.createdAt}
dateStart={poll.dateRange.start}
dateEnd={poll.dateRange.end}
/>
))}
</div>

View file

@ -64,9 +64,9 @@ export function Sidebar() {
const posthog = usePostHog();
return (
<nav className="flex flex-1 flex-col ">
<ul role="list" className="flex flex-1 flex-col gap-y-7">
<ul role="list" className="flex flex-1 flex-col gap-y-8">
<li>
<ul role="list" className="-mx-2 space-y-1">
<ul role="list" className="-mx-2 space-y-2">
<li>
<NavItem current={pathname === "/"} href="/" icon={HomeIcon}>
<Trans i18nKey="home" defaults="Home" />

View file

@ -19,7 +19,7 @@ export function PageIcon({
className?: string;
}) {
return (
<div className={cn("hidden", className)}>
<div className={cn("hidden rounded-md border bg-gray-50 p-2", className)}>
<Slot className="size-4">{children}</Slot>
</div>
);
@ -43,7 +43,9 @@ export function PageHeader({
className?: string;
variant?: "default" | "ghost";
}) {
return <div className={cn(className)}>{children}</div>;
return (
<div className={cn("flex items-center gap-x-4", className)}>{children}</div>
);
}
export function PageSection({ children }: { children?: React.ReactNode }) {

View file

@ -24,14 +24,6 @@ export function Subheading({
className,
}: React.PropsWithChildren<{ className?: string }>) {
return (
<h2
className={cn(
"text-base font-semibold text-gray-900",
heading.className,
className,
)}
>
{children}
</h2>
<h2 className={cn("text-base font-semibold", className)}>{children}</h2>
);
}

View file

@ -7,7 +7,7 @@ import { cn } from "./lib/utils";
const buttonVariants = cva(
cn(
"inline-flex border font-medium disabled:pointer-events-none select-none disabled:opacity-50 items-center justify-center whitespace-nowrap border",
"inline-flex border transition-colors font-medium disabled:pointer-events-none select-none disabled:opacity-50 items-center justify-center whitespace-nowrap border",
"focus-visible:ring-offset-input-background",
"focus:shadow-none",
),