Skip to content

Commit c64188b

Browse files
author
belledw
committed
added 'add health event' menu to health section
1 parent 9639e6f commit c64188b

3 files changed

Lines changed: 77 additions & 3 deletions

File tree

client/src/components/ui/add-event-menu.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
import { Check, X } from "lucide-react";
44

55
import { Button } from "@/components/ui/button";
6-
import { CardTitle } from "@/components/ui/card";
76
import { DateTimePicker } from "@/components/ui/date-time-picker";
87
import { Field, FieldGroup, FieldLabel } from "@/components/ui/field";
98
import { Input } from "@/components/ui/input";
9+
import { TextTitle } from "@/components/ui/text-styles";
1010

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

client/src/pages/pet.tsx

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

44
import { AddEvent } from "@/components/ui/add-event-menu";
5+
import { AddHealthEvent } from "@/components/ui/add-health-event-menu";
56
import { AddTask } from "@/components/ui/add-task-menu";
67
import { Button } from "@/components/ui/button";
78
import { Calendar } from "@/components/ui/calendar";
@@ -18,6 +19,7 @@ export default function Default() {
1819
const [taskMenu, setTaskMenu] = useState(false);
1920
const [settingsMenu, setSettingsMenu] = useState(false);
2021
const [eventMenu, setEventMenu] = useState(false);
22+
const [healthMenu, setHealthMenu] = useState(false);
2123

2224
return (
2325
<div className={dm_sans.className}>
@@ -99,7 +101,7 @@ export default function Default() {
99101
<Button
100102
className="mt-5 w-full p-5"
101103
variant="outline"
102-
onClick={() => "Add function later"}
104+
onClick={() => setHealthMenu(true)}
103105
>
104106
<Plus className="mr-1" /> Add health event
105107
</Button>
@@ -108,6 +110,9 @@ export default function Default() {
108110
<HealthOverview title="Vomit" occurrences="3" />
109111
</div>
110112
</div>
113+
{healthMenu === true && (
114+
<AddHealthEvent onClickClose={() => setHealthMenu(false)} />
115+
)}
111116
</div>
112117
<div className="h-[75]"></div>
113118
</div>

0 commit comments

Comments
 (0)