Skip to content

Commit 5628745

Browse files
committed
created mobile friendly version, fixed update bug with exercise
1 parent ffd07b0 commit 5628745

16 files changed

Lines changed: 129 additions & 227 deletions

File tree

src/app/dashboard/components/nav.tsx

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const Navigation = () => {
1818
return (
1919
<NavigationMenu>
2020
<NavigationMenuList>
21-
<NavigationMenuItem>
21+
{/* <NavigationMenuItem>
2222
<Link href="/dashboard" legacyBehavior passHref>
2323
<NavigationMenuLink
2424
className={navigationMenuTriggerStyle()}
@@ -27,7 +27,7 @@ export const Navigation = () => {
2727
Dashboard
2828
</NavigationMenuLink>
2929
</Link>
30-
</NavigationMenuItem>
30+
</NavigationMenuItem> */}
3131
<NavigationMenuItem>
3232
<Link href="/dashboard/day" legacyBehavior passHref>
3333
<NavigationMenuLink
@@ -48,7 +48,7 @@ export const Navigation = () => {
4848
</NavigationMenuLink>
4949
</Link>
5050
</NavigationMenuItem>
51-
<NavigationMenuItem>
51+
{/* <NavigationMenuItem>
5252
<Link href="/dashboard/feedback" legacyBehavior passHref>
5353
<NavigationMenuLink
5454
className={navigationMenuTriggerStyle()}
@@ -57,17 +57,17 @@ export const Navigation = () => {
5757
Feedback
5858
</NavigationMenuLink>
5959
</Link>
60-
</NavigationMenuItem>
60+
</NavigationMenuItem> */}
6161
<NavigationMenuItem>
6262
<NavigationMenuTrigger>Configure</NavigationMenuTrigger>
6363
<NavigationMenuContent>
64-
<ul className="grid w-[400px] gap-3 p-4 md:w-[500px] md:grid-cols-2 lg:w-[600px] ">
65-
<Link href="/dashboard/configure/supplements">
66-
<h3 className="text-md font-medium leading-none">
67-
Supplements
68-
</h3>
69-
<p className="mt-1 text-sm">Configure your supplements.</p>
70-
</Link>
64+
<ul className="mx-2 grid w-[350px] gap-3 p-4 md:w-[500px] md:grid-cols-2 lg:w-[600px]">
65+
<ListItem
66+
title="Supplements"
67+
href="/dashboard/configure/supplements "
68+
>
69+
Configure supplements you use
70+
</ListItem>
7171
</ul>
7272
</NavigationMenuContent>
7373
</NavigationMenuItem>
@@ -97,8 +97,6 @@ const ListItem = React.forwardRef<
9797
<li>
9898
<NavigationMenuLink asChild>
9999
<Link
100-
passHref
101-
legacyBehavior
102100
href={props.href!}
103101
ref={ref}
104102
className={cn(
@@ -107,12 +105,10 @@ const ListItem = React.forwardRef<
107105
)}
108106
{...props}
109107
>
110-
<a>
111-
<div className="text-sm font-medium leading-none">{title}</div>
112-
<p className="text-muted-foreground line-clamp-2 text-sm leading-snug">
113-
{children}
114-
</p>
115-
</a>
108+
<div className="text-sm font-medium leading-none">{title}</div>
109+
<p className="text-muted-foreground line-clamp-2 text-sm leading-snug">
110+
{children}
111+
</p>
116112
</Link>
117113
</NavigationMenuLink>
118114
</li>

src/app/dashboard/components/navDemo.tsx

Lines changed: 0 additions & 145 deletions
This file was deleted.

src/app/dashboard/configure/supplements/components/showSupplements.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { updateSupplementActivation } from "~/lib/actions/supplementAction";
99
import { toCapitalize } from "~/lib/misc/useUpperCase";
1010
import type { readSupplementSchema } from "~/lib/schemas/supplement";
1111
import { SupplementHoverCard as SHC } from "./supplementHover";
12-
import { getSupplementsConfig, useSupplements } from "~/lib/hooks/supplements";
12+
import { getSupplementsConfig } from "~/lib/hooks/supplements";
1313
import { Skeleton } from "~/components/ui/skeleton";
1414
import { useQuery } from "@tanstack/react-query";
1515

src/app/dashboard/configure/supplements/components/supplementHover.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ export const SupplementHoverCard = ({
3636
children: React.ReactNode;
3737
}) => {
3838
return (
39-
<HoverCard openDelay={100} closeDelay={50}>
39+
<HoverCard openDelay={1000} closeDelay={50}>
4040
<HoverCardTrigger>{children}</HoverCardTrigger>
41-
<HoverCardContent className="w-[400px] ">
41+
<HoverCardContent className="w-[400px]">
4242
<SupplementFactsTable ingredients={supplement?.ingredients} />
4343
</HoverCardContent>
4444
</HoverCard>

src/app/dashboard/configure/supplements/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default async function Page() {
2828
return (
2929
<div className="grid h-[90vh] gap-4 md:grid-cols-5 lg:grid-cols-3">
3030
<HydrationBoundary state={dehydrate(queryClient)}>
31-
<ShowConfiguredSupplements className="rounded-md border p-4 shadow-lg md:col-span-2 md:col-start-1 lg:col-span-1 lg:col-start-1 " />
31+
<ShowConfiguredSupplements className="h-[50vh] rounded-md border p-4 shadow-lg md:col-span-2 md:col-start-1 md:h-auto lg:col-span-1 lg:col-start-1" />
3232
</HydrationBoundary>
3333
<ConfigureSupplements className="rounded-md border p-4 shadow-lg md:col-span-4 md:col-start-3 lg:col-span-5 lg:col-start-2" />
3434
</div>

src/app/dashboard/day/[date]/edit/page.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ const Page = async ({ params }: { params: { date: string } }) => {
77
const { supplements, id, exercise, form_misc, health, sleep, stress } =
88
await readDayDataForEdit(date);
99

10-
console.log(exercise);
11-
// can I resuse the day form and make default values but send it to an update???
10+
// can I reuse the day form and make default values but send it to an update???
1211
// how can I detect which fields are being updated? and then trigger only those fields?
1312
// ? Should I parse the data with the daySchema?
1413

@@ -18,7 +17,7 @@ const Page = async ({ params }: { params: { date: string } }) => {
1817
id={id}
1918
supplements={supplements}
2019
// @ts-expect-error look below
21-
exercise={exercise} // errors in config string != "low" | "medium" | "high" schema is set this way but the dat coming from the zod schema is just a string. Alter this in the data pull
20+
exercise={exercise} // errors in config string != "low" | "medium" | "high" schema
2221
form_misc={form_misc}
2322
health={health}
2423
sleep={sleep}

0 commit comments

Comments
 (0)