This commit is contained in:
Luke Vella 2024-02-13 16:49:52 +08:00
parent d203ca7b6b
commit 00df1a2e40
5 changed files with 78 additions and 42 deletions

View file

@ -40,7 +40,7 @@ import {
InviteCard, InviteCard,
InviteCardForm, InviteCardForm,
InviteCardGeneral, InviteCardGeneral,
} from "@/app/[locale]/create/invite-card"; } from "@/app/[locale]/(admin)/create/invite-card";
import { import {
PageContainer, PageContainer,
PageContent, PageContent,
@ -426,8 +426,8 @@ export function CreateForm() {
<div className="max-w-xl grow"> <div className="max-w-xl grow">
<CreateFormInput /> <CreateFormInput />
</div> </div>
<div className="rounded-md border bg-gray-100 px-5 py-4"> <div className="hidden rounded-md border bg-gray-100 px-5 py-4 lg:block">
<h2 className="text-muted-foreground mb-1 text-sm">Preview</h2> <div className="text-muted-foreground mb-1 text-sm">Preview</div>
<CreateFormPreview /> <CreateFormPreview />
</div> </div>
</form> </form>

View file

@ -1,18 +1,14 @@
import { Button } from "@rallly/ui/button"; import { Button } from "@rallly/ui/button";
import { ArrowLeftIcon, ChevronRightIcon, XIcon } from "lucide-react"; import { ChevronRightIcon, XIcon } from "lucide-react";
import Link from "next/link"; import Link from "next/link";
import { CreateForm } from "@/app/[locale]/create/create-form"; import { CreateForm } from "@/app/[locale]/(admin)/create/create-form";
import { import { PageContainer, PageContent } from "@/app/components/page-layout";
PageContainer,
PageContent,
PageHeader,
} from "@/app/components/page-layout";
import { getTranslation } from "@/app/i18n"; import { getTranslation } from "@/app/i18n";
export default async function Page({ params }: { params: { locale: string } }) { export default async function Page({ params }: { params: { locale: string } }) {
return ( return (
<PageContainer className="flex flex-col bg-white"> <PageContainer className="flex flex-col bg-gray-50">
<PageContent className="grow"> <PageContent className="grow">
<div className="mb-4 flex items-center justify-between"> <div className="mb-4 flex items-center justify-between">
<div className="text-muted-foreground flex items-center gap-x-4 text-sm"> <div className="text-muted-foreground flex items-center gap-x-4 text-sm">

View file

@ -58,6 +58,7 @@ model User {
events Event[] events Event[]
subscription Subscription? @relation(fields: [subscriptionId], references: [id]) subscription Subscription? @relation(fields: [subscriptionId], references: [id])
accounts Account[] accounts Account[]
schedulingPolls SchedulingPoll[]
@@map("users") @@map("users")
} }
@ -205,6 +206,45 @@ model Participant {
@@map("participants") @@map("participants")
} }
model SchedulingPoll {
id String @id @default(cuid())
userId String @map("user_id")
user User @relation(fields: [userId], references: [id])
prompt String?
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
eventTitle String @map("event_title")
eventDescription String? @map("event_description")
eventLocation String? @map("event_location")
eventTimeZone String? @map("time_zone")
eventDuration Int? @map("event_duration_minutes")
pollOptions DateTime[] @map("poll_options")
responses SchedulingPollResponse[]
@@index([userId], type: Hash)
@@map("scheduling_polls")
}
model SchedulingPollResponse {
id String @id @default(cuid())
userId String @map("user_id")
name String
email String
timeZone String @map("time_zone")
locale String
notificationsEnabled Boolean @map("notifications_enabled")
schedulingPollId String @map("scheduling_poll_id")
votes Json
createdAt DateTime @default(now()) @map("created_at")
schedulingPoll SchedulingPoll @relation(fields: [schedulingPollId], references: [id])
availabilityHeatmapId String?
@@index([schedulingPollId], type: Hash)
@@map("scheduling_poll_responses")
}
model Option { model Option {
id String @id @default(cuid()) id String @id @default(cuid())
start DateTime @db.Timestamp(0) start DateTime @db.Timestamp(0)