Skip to content

Commit a3d4360

Browse files
committed
Some UI/UX tweaks to the OverarchingGoalComponent's margins, padding and drawer onClick trigger.
1 parent 1314e49 commit a3d4360

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

src/components/ui/coaching-sessions/overarching-goal.tsx

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ const OverarchingGoalComponent: React.FC<{
4949
<div className="flex items-center justify-between px-4">
5050
<div
5151
className={cn(
52-
"relative h-8 w-full justify-start rounded-[0.5rem] bg-muted hover:bg-gray-200 text-sm font-semibold text-muted-foreground shadow-inner flex items-center px-3"
52+
"relative h-8 w-full justify-start rounded-[0.5rem] bg-muted hover:bg-gray-200 text-sm font-semibold text-muted-foreground shadow-inner flex items-center pl-0 pr-2"
5353
)}
54+
onClick={toggleDrawer}
5455
>
5556
<div className="flex items-center justify-between w-full">
5657
<div id="label" className="flex w-full mr-2 min-w-0">
@@ -59,16 +60,24 @@ const OverarchingGoalComponent: React.FC<{
5960
value={tempGoalTitle}
6061
onChange={(e) => setTempGoalTitle(e.target.value)}
6162
onKeyDown={(e) => e.key === "Enter" && handleSetGoal()}
62-
className={cn("w-full h-6 bg-inherit border-0 p-1")}
63+
onClick={(e) => e.stopPropagation()} // Ensure clicking the input component does not call toggleDrawer
64+
className={cn("w-full h-6 bg-inherit border-0 px-2 py-1")}
6365
placeholder="Insert a new overarching goal"
6466
/>
6567
) : (
66-
<div>
68+
/* Ensure that clicking the overarching goal text (e.g. if the user wants to highlight the text)
69+
does not call toggleDrawer */
70+
<div className="ml-2 mr-2">
6771
<span className="hidden md:inline-flex truncate">
6872
<div className="mr-1">{"Overarching goal: "}</div>
69-
<div>{overarchingGoal.title}</div>
73+
<div onClick={(e) => e.stopPropagation()}>
74+
{overarchingGoal.title}
75+
</div>
7076
</span>
71-
<span className="inline-flex md:hidden">
77+
<span
78+
className="inline-flex md:hidden"
79+
onClick={(e) => e.stopPropagation()}
80+
>
7281
{overarchingGoal.title}
7382
</span>
7483
</div>

0 commit comments

Comments
 (0)