Skip to content

Commit 90bda1e

Browse files
authored
Where To Meet toggle when creating a new Plan (#3314)
2 parents d214763 + 1f521a1 commit 90bda1e

File tree

4 files changed

+95
-33
lines changed

4 files changed

+95
-33
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
alter table "public"."meet_together_plans" add column "where_to_meet" boolean not null default false;
2+
3+

bun.lock

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4597,10 +4597,6 @@
45974597

45984598
"@react-email/preview-server/@babel/core/@babel/traverse": ["@babel/traverse@7.28.0", "", { "dependencies": { "@babel/code-frame": "^7.27.1", "@babel/generator": "^7.28.0", "@babel/helper-globals": "^7.28.0", "@babel/parser": "^7.28.0", "@babel/template": "^7.27.2", "@babel/types": "^7.28.0", "debug": "^4.3.1" } }, "sha512-mGe7UK5wWyh0bKRfupsUchrQGqvDbZDbKJw+kcRGSmdHVYrv+ltd0pnpDTVpiTqnaBru9iEvA8pz8W46v0Amwg=="],
45994599

4600-
"@react-email/preview-server/@babel/traverse/@babel/parser": ["@babel/parser@7.28.0", "", { "dependencies": { "@babel/types": "^7.28.0" }, "bin": "./bin/babel-parser.js" }, "sha512-jVZGvOxOuNSsuQuLRTh13nU0AogFlw32w/MT+LV6D3sP5WdbW61E77RnkbaO2dUvmPAYrBDJXGn5gGS6tH4j8g=="],
4601-
4602-
"@react-email/preview-server/@babel/traverse/globals": ["globals@11.12.0", "", {}, "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA=="],
4603-
46044600
"@react-email/preview-server/@radix-ui/react-collapsible/@radix-ui/react-presence": ["@radix-ui/react-presence@1.1.3", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-use-layout-effect": "1.1.1" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-IrVLIhskYhH3nLvtcBLQFZr61tBG7wx7O3kEmdzcYwRGAEBmBicGGL7ATzNgruYJ3xBTbuzEEq9OXJM3PAX3tA=="],
46054601

46064602
"@react-email/preview-server/@radix-ui/react-collapsible/@radix-ui/react-primitive": ["@radix-ui/react-primitive@2.1.0", "", { "dependencies": { "@radix-ui/react-slot": "1.2.0" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-/J/FhLdK0zVcILOwt5g+dH4KnkonCtkVJsa2G6JmvbbtZfBEI1gMsO3QMjseL4F/SwfAMt1Vc/0XKYKq+xJ1sw=="],

packages/types/src/supabase.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2722,6 +2722,7 @@ export type Database = {
27222722
is_public: boolean;
27232723
name: string | null;
27242724
start_time: string;
2725+
where_to_meet: boolean;
27252726
ws_id: string | null;
27262727
};
27272728
Insert: {
@@ -2734,6 +2735,7 @@ export type Database = {
27342735
is_public?: boolean;
27352736
name?: string | null;
27362737
start_time: string;
2738+
where_to_meet?: boolean;
27372739
ws_id?: string | null;
27382740
};
27392741
Update: {
@@ -2746,6 +2748,7 @@ export type Database = {
27462748
is_public?: boolean;
27472749
name?: string | null;
27482750
start_time?: string;
2751+
where_to_meet?: boolean;
27492752
ws_id?: string | null;
27502753
};
27512754
Relationships: [

packages/ui/src/components/ui/legacy/tumeet/create-plan-dialog.tsx

Lines changed: 89 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ import { useForm } from '@tuturuuu/ui/hooks/use-form';
2323
import { toast } from '@tuturuuu/ui/hooks/use-toast';
2424
import { Input } from '@tuturuuu/ui/input';
2525
import { zodResolver } from '@tuturuuu/ui/resolvers';
26+
import { Separator } from '@tuturuuu/ui/separator';
2627
import { cn } from '@tuturuuu/utils/format';
2728
import dayjs from 'dayjs';
29+
import { MapPin, Sparkles } from 'lucide-react';
2830
import { useTranslations } from 'next-intl';
2931
import { useRouter } from 'next/navigation';
3032
import { useState } from 'react';
@@ -48,6 +50,7 @@ const FormSchema = z.object({
4850
dates: z.array(z.string()).optional(),
4951
is_public: z.boolean().optional(),
5052
ws_id: z.string().optional(),
53+
where_to_meet: z.boolean().optional(), // <-- Added field
5154
});
5255

5356
const convertToTimetz = (
@@ -61,7 +64,6 @@ const convertToTimetz = (
6164
export default function CreatePlanDialog({ plan }: Props) {
6265
const t = useTranslations('meet-together');
6366
const router = useRouter();
64-
6567
const [isOpened, setIsOpened] = useState(false);
6668
const [creating, setCreating] = useState(false);
6769

@@ -76,17 +78,16 @@ export default function CreatePlanDialog({ plan }: Props) {
7678
?.map((date) => dayjs(date).format('YYYY-MM-DD')),
7779
is_public: true,
7880
ws_id: plan.wsId,
81+
where_to_meet: false, // <-- Default value
7982
},
8083
});
8184

8285
const isValid = form.formState.isValid;
8386
const isSubmitting = form.formState.isSubmitting;
84-
8587
const disabled = !isValid || isSubmitting;
8688

8789
const handleSubmit = async () => {
8890
setCreating(true);
89-
9091
const data = form.getValues();
9192
let hasError = false;
9293

@@ -173,39 +174,16 @@ export default function CreatePlanDialog({ plan }: Props) {
173174
{t('create_plan')}
174175
</div>
175176
</button>
176-
{/* <button
177-
className={`${
178-
179-
} group relative inline-flex w-full`}
180-
onClick={() => setIsOpened(true)}
181-
disabled={missingFields || creating}
182-
>
183-
<div
184-
className={cn(
185-
'from-dynamic-light-red via-dynamic-light-pink to-dynamic-light-blue bg-linear-to-r',
186-
missingFields || creating
187-
? 'opacity-10'
188-
: 'group-hover:opacity-30',
189-
'absolute rounded-lg blur transition-all duration-500'
190-
)}
191-
/>
192-
<div
193-
className={`from-dynamic-light-red via-dynamic-light-pink to-dynamic-light-blue relative inline-flex w-full items-center justify-center rounded-lg bg-linear-to-r px-8 py-2 font-bold text-white transition-all md:text-lg`}
194-
>
195-
{t('create_plan')}
196-
</div>
197-
</button> */}
198177
</DialogTrigger>
199-
<DialogContent className="sm:max-w-[425px]">
178+
<DialogContent className="sm:max-w-[500px]">
200179
<DialogHeader>
201180
<DialogTitle>{t('new_plan')}</DialogTitle>
202181
<DialogDescription>{t('new_plan_desc')}</DialogDescription>
203182
</DialogHeader>
204-
205183
<Form {...form}>
206184
<form
207185
onSubmit={form.handleSubmit(handleSubmit)}
208-
className="space-y-3"
186+
className="space-y-4"
209187
>
210188
<FormField
211189
control={form.control}
@@ -221,7 +199,89 @@ export default function CreatePlanDialog({ plan }: Props) {
221199
)}
222200
/>
223201

224-
<DialogFooter>
202+
<Separator className="my-6" />
203+
204+
{/* Extra Features Section */}
205+
<div className="space-y-4">
206+
<div className="flex items-center gap-2">
207+
<Sparkles className="h-4 w-4 text-purple-500" />
208+
<h3 className="text-sm font-semibold text-foreground">
209+
Extra Features
210+
</h3>
211+
</div>
212+
<p className="text-xs text-muted-foreground">
213+
Enhance your meeting plan with additional features to make
214+
coordination easier.
215+
</p>
216+
217+
{/* Where-to-meet feature */}
218+
<FormField
219+
control={form.control}
220+
name="where_to_meet"
221+
render={({ field }) => (
222+
<FormItem>
223+
<div
224+
className="cursor-pointer rounded-lg border border-border bg-muted/30 p-4 transition-colors hover:bg-muted/50"
225+
onClick={() => field.onChange(!field.value)}
226+
>
227+
<div className="flex items-start space-x-3">
228+
<FormControl>
229+
<input
230+
type="checkbox"
231+
id="where_to_meet"
232+
checked={field.value}
233+
onChange={field.onChange}
234+
className="mt-1 h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500"
235+
/>
236+
</FormControl>
237+
<div className="flex-1 space-y-2">
238+
<div className="flex items-center gap-2">
239+
<MapPin className="h-4 w-4 text-blue-500" />
240+
<FormLabel
241+
htmlFor="where_to_meet"
242+
className="mb-0 cursor-pointer font-medium text-foreground"
243+
onClick={(e) => e.stopPropagation()}
244+
>
245+
Where TuMeet?
246+
</FormLabel>
247+
</div>
248+
<p className="text-xs leading-relaxed text-muted-foreground">
249+
Enable location suggestions and voting. Participants
250+
can propose meeting locations and vote on their
251+
preferred spots, making it easier to find the
252+
perfect place for everyone.
253+
</p>
254+
<div className="flex items-center gap-1 text-xs text-blue-600">
255+
<span>✨ Popular feature</span>
256+
</div>
257+
</div>
258+
</div>
259+
</div>
260+
<FormMessage />
261+
</FormItem>
262+
)}
263+
/>
264+
265+
{/* Placeholder for future features */}
266+
<div className="rounded-lg border border-dashed border-border/50 bg-muted/20 p-4">
267+
<div className="flex items-center justify-center text-center">
268+
<div className="space-y-2">
269+
<div className="flex items-center justify-center gap-2 text-muted-foreground">
270+
<Sparkles className="h-4 w-4" />
271+
<span className="text-sm font-medium">
272+
More features coming soon!
273+
</span>
274+
</div>
275+
<p className="text-xs text-muted-foreground">
276+
We&apos;re working on additional features to make your
277+
meetings even better.
278+
</p>
279+
</div>
280+
</div>
281+
</div>
282+
</div>
283+
284+
<DialogFooter className="pt-4">
225285
<Button
226286
type="submit"
227287
className="w-full"

0 commit comments

Comments
 (0)