Skip to content

Commit f378065

Browse files
authored
Merge pull request #54 from refactor-group/some_final_tweaks_for_1.0-rc1
2 parents 79646ad + 07e8f73 commit f378065

File tree

10 files changed

+23
-53
lines changed

10 files changed

+23
-53
lines changed
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import type { Metadata } from "next";
22
import "@/styles/globals.css";
3-
import { siteConfig } from "@/site.config.ts"
3+
import { siteConfig } from "@/site.config.ts";
44

5-
import { SiteHeader } from "@/components/ui/site-header"
5+
import { SiteHeader } from "@/components/ui/site-header";
66

77
export const metadata: Metadata = {
88
title: siteConfig.name,
@@ -15,11 +15,11 @@ export default function CoachingSessionLayout({
1515
children: React.ReactNode;
1616
}>) {
1717
return (
18-
<>
18+
// Ensure that SiteHeader has enough vertical space to stay sticky at the top
19+
// of the page by using "min-h-screen" in the parent div
20+
<div className="min-h-screen">
1921
<SiteHeader />
20-
<main>
21-
{children}
22-
</main>
23-
</>
22+
<main>{children}</main>
23+
</div>
2424
);
25-
}
25+
}

src/app/coaching-sessions/[id]/page.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ import { Separator } from "@/components/ui/separator";
88
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
99
import { Textarea } from "@/components/ui/textarea";
1010

11-
import { PresetActions } from "@/components/ui/preset-actions";
12-
import { PresetSelector } from "@/components/ui/preset-selector";
13-
import { current, future, past } from "@/data/presets";
1411
import { useAppStateStore } from "@/lib/providers/app-state-store-provider";
1512
import { useEffect, useRef, useState } from "react";
1613
import {
@@ -41,9 +38,10 @@ import { CoachingSession } from "@/types/coaching-session";
4138
import { useRouter } from "next/navigation";
4239
import { fetchCoachingSessions } from "@/lib/api/coaching-sessions";
4340

41+
// TODO: can't make this page be server side yet until we move useRouter/useEffect out of this page
4442
// export const metadata: Metadata = {
4543
// title: "Coaching Session",
46-
// description: "Coaching session main page, where the good stuff happens.",
44+
// description: "Main coaching session page",
4745
// };
4846

4947
export default function CoachingSessionsPage() {

src/app/dashboard/layout.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import type { Metadata } from "next";
22
import "@/styles/globals.css";
3-
import { siteConfig } from "@/site.config.ts"
3+
import { siteConfig } from "@/site.config.ts";
44

5-
import { SiteHeader } from "@/components/ui/site-header"
5+
import { SiteHeader } from "@/components/ui/site-header";
66

77
export const metadata: Metadata = {
88
title: siteConfig.name,
@@ -15,11 +15,11 @@ export default function CoachingSessionLayout({
1515
children: React.ReactNode;
1616
}>) {
1717
return (
18-
<>
18+
// Ensure that SiteHeader has enough vertical space to stay sticky at the top
19+
// of the page by using "min-h-screen" in the parent div
20+
<div className="min-h-screen">
1921
<SiteHeader />
20-
<main>
21-
{children}
22-
</main>
23-
</>
22+
<main>{children}</main>
23+
</div>
2424
);
25-
}
25+
}

src/app/dashboard/page.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
"use client";
22

3-
// import { Metadata } from "next";
3+
import { Metadata } from "next";
44

55
import * as React from "react";
66

7-
import Image from "next/image";
8-
97
import { cn } from "@/lib/utils";
108

119
import { SelectCoachingSession } from "@/components/ui/dashboard/select-coaching-session";
1210
import { useAuthStore } from "@/lib/providers/auth-store-provider";
1311

12+
// TODO: can't make this page be server side yet (not sure why on this page)
1413
// export const metadata: Metadata = {
1514
// title: "Dashboard",
1615
// description: "Coaching dashboard",

src/app/login/page.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Metadata } from "next";
2-
import Image from "next/image";
32
import Link from "next/link";
43

54
import { cn } from "@/lib/utils";

src/components/ui/coaching-sessions/actions-list.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ const ActionsList: React.FC<{
201201
async function loadActions() {
202202
if (!coachingSessionId) {
203203
console.error(
204-
"Failed to fetch Actions since coachingSession.id is not set."
204+
"Failed to fetch Actions since coachingSessionId is not set."
205205
);
206206
return;
207207
}

src/components/ui/coaching-sessions/agreements-list.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ const AgreementsList: React.FC<{
3333
onAgreementDeleted: (id: Id) => Promise<Agreement>;
3434
}> = ({
3535
coachingSessionId,
36-
userId,
37-
locale,
3836
onAgreementAdded,
3937
onAgreementEdited,
4038
onAgreementDeleted,
@@ -155,7 +153,7 @@ const AgreementsList: React.FC<{
155153
async function loadAgreements() {
156154
if (!coachingSessionId) {
157155
console.error(
158-
"Failed to fetch Agreements since coachingSession.id is not set."
156+
"Failed to fetch Agreements since coachingSessionId is not set."
159157
);
160158
return;
161159
}

src/components/ui/site-header.tsx

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,7 @@ import { MobileNav } from "@/components/ui/mobile-nav";
66
import { ModeToggle } from "@/components/ui/mode-toggle";
77
import { UserNav } from "@/components/ui/user-nav";
88

9-
// import { useRouter } from 'next/navigation'
10-
// import { useAuthStore } from "@/lib/providers/auth-store-provider";
11-
129
export function SiteHeader() {
13-
// This must have "use client" at the top, hooks don't work on server components
14-
// or you'll get a very strange runtime error about useAuthStore() not being a function.
15-
// const { isLoggedIn } = useAuthStore(
16-
// (state) => state,
17-
// )
18-
// const router = useRouter();
19-
2010
return (
2111
<header className="sticky top-0 z-50 w-full border-b border-border/40 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60">
2212
<div className="flex h-14 pl-4 pt-2 max-w-screen-2xl items-start">
@@ -28,18 +18,7 @@ export function SiteHeader() {
2818
</div>
2919
<nav className="flex items-center">
3020
<ModeToggle />
31-
{/* {isLoggedIn ? ( */}
3221
<UserNav />
33-
{/* ) : ( */}
34-
{/* <> */}
35-
{/* {console.warn("User is not logged in, redirecting to login route.")} */}
36-
{/* TODO: For some reason, this is causing a redirect boundary error / trying to update
37-
2 components (Router) + (SiteHeader) at the same time. I think it has to do with the
38-
AuthStoreProvider and the two different layouts.
39-
Help: https://reactjs.org/link/setstate-in-render */}
40-
{/* router.push("/login") */}
41-
{/* </> */}
42-
{/* )} */}
4322
</nav>
4423
</div>
4524
</div>

src/lib/api/overarching-goals.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@
22

33
import {
44
OverarchingGoal,
5-
overarchingGoalToString,
65
defaultOverarchingGoal,
76
isOverarchingGoal,
87
isOverarchingGoalArray,
98
parseOverarchingGoal,
109
} from "@/types/overarching-goal";
1110
import { ItemStatus, Id } from "@/types/general";
1211
import { AxiosError, AxiosResponse } from "axios";
13-
import { DateTime } from "ts-luxon";
1412
import { siteConfig } from "@/site.config";
1513

1614
export const fetchOverarchingGoalsByCoachingSessionId = async (

src/types/overarching-goal.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { DateTime } from "ts-luxon";
2-
import { Id, ItemStatus, SortOrder } from "@/types/general";
1+
import { Id, ItemStatus } from "@/types/general";
32

43
// This must always reflect the Rust struct on the backend
54
// entity::overarching_goals::Model

0 commit comments

Comments
 (0)