Skip to content

Commit 9639e6f

Browse files
author
belledw
committed
added 'add event' menu to calendar section
1 parent 85aaa86 commit 9639e6f

2 files changed

Lines changed: 85 additions & 1 deletion

File tree

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
"use client";
2+
3+
import { Check, X } from "lucide-react";
4+
5+
import { Button } from "@/components/ui/button";
6+
import { CardTitle } from "@/components/ui/card";
7+
import { DateTimePicker } from "@/components/ui/date-time-picker";
8+
import { Field, FieldGroup, FieldLabel } from "@/components/ui/field";
9+
import { Input } from "@/components/ui/input";
10+
11+
interface AddEventProps {
12+
className?: string;
13+
onClickClose: () => void;
14+
}
15+
16+
export function AddEvent(props: AddEventProps) {
17+
return (
18+
<div className="flex flex-col gap-5">
19+
<hr className="mb-2 mt-10"></hr>
20+
<CardTitle className="flex gap-2 text-3xl">Add Event</CardTitle>
21+
<FieldGroup>
22+
<Field>
23+
<FieldLabel htmlFor="checkout-7j9-card-name-43j">
24+
Event Title
25+
</FieldLabel>
26+
<Input
27+
id="checkout-7j9-card-name-43j"
28+
placeholder="Vet Appointment for Spaghetti"
29+
required
30+
/>
31+
</Field>
32+
<DateTimePicker />
33+
<div className="lg:max-w-2/3 flex gap-5">
34+
<Field>
35+
<FieldLabel htmlFor="checkout-7j9-card-name-4">Location</FieldLabel>
36+
<Input
37+
id="checkout-7j9-card-name-4"
38+
placeholder="Type a location"
39+
required
40+
/>
41+
</Field>
42+
<Field>
43+
<FieldLabel htmlFor="checkout-7j9-card-name">For Pet</FieldLabel>
44+
<Input
45+
id="checkout-7j9-card-name"
46+
placeholder="Spaghetti"
47+
required
48+
/>
49+
</Field>
50+
</div>
51+
<Field>
52+
<FieldLabel htmlFor="checkout-7j9-card-name-">
53+
Description (optional)
54+
</FieldLabel>
55+
<Input
56+
id="checkout-7j9-card-name-"
57+
placeholder="50.0 g x Premium Cat Biscuits"
58+
/>
59+
</Field>
60+
</FieldGroup>
61+
<div className="mt-5 flex items-center gap-5">
62+
<Button
63+
className="gray-600 hover:gray-400 rounded-full"
64+
onClick={props.onClickClose}
65+
>
66+
<Check className="mr-1" /> Save Event
67+
</Button>
68+
<Button
69+
className="rounded-full"
70+
variant="outline"
71+
onClick={props.onClickClose}
72+
>
73+
<X className="mr-1" /> Discard and close
74+
</Button>
75+
</div>
76+
<hr className="mt-5"></hr>
77+
</div>
78+
);
79+
}

client/src/pages/pet.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Check, Plus } from "lucide-react";
22
import { useState } from "react";
33

4+
import { AddEvent } from "@/components/ui/add-event-menu";
45
import { AddTask } from "@/components/ui/add-task-menu";
56
import { Button } from "@/components/ui/button";
67
import { Calendar } from "@/components/ui/calendar";
@@ -16,6 +17,7 @@ import { dm_sans } from "@/lib/fonts";
1617
export default function Default() {
1718
const [taskMenu, setTaskMenu] = useState(false);
1819
const [settingsMenu, setSettingsMenu] = useState(false);
20+
const [eventMenu, setEventMenu] = useState(false);
1921

2022
return (
2123
<div className={dm_sans.className}>
@@ -74,12 +76,15 @@ export default function Default() {
7476
<Button
7577
className="mt-5 w-full p-5"
7678
variant="outline"
77-
onClick={() => "Add function later"}
79+
onClick={() => setEventMenu(true)}
7880
>
7981
<Plus className="mr-1" /> Add event
8082
</Button>
8183
</div>
8284
</div>
85+
{eventMenu === true && (
86+
<AddEvent onClickClose={() => setEventMenu(false)} />
87+
)}
8388

8489
<TextTitle className="mt-10 text-3xl"> Health </TextTitle>
8590
<div className="flex flex-wrap gap-x-10">

0 commit comments

Comments
 (0)