File tree Expand file tree Collapse file tree 4 files changed +37
-17
lines changed
organizations/[id]/members Expand file tree Collapse file tree 4 files changed +37
-17
lines changed Original file line number Diff line number Diff line change 11import type { Metadata } from "next" ;
22import { DashboardContainer } from "../../components/ui/dashboard/dashboard-container" ;
3+ import { PageContainer } from "@/components/ui/page-container" ;
34
45export const metadata : Metadata = {
56 title : "Dashboard" ,
67 description : "Coaching dashboard" ,
78} ;
89
910export default function DashboardPage ( ) {
10- return < DashboardContainer /> ;
11+ return (
12+ < PageContainer >
13+ < DashboardContainer />
14+ </ PageContainer >
15+ ) ;
1116}
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import { useUserList } from "@/lib/api/organizations/users";
99import { useOrganizationStateStore } from "@/lib/providers/organization-state-store-provider" ;
1010import { Id } from "@/types/general" ;
1111import { MemberContainer } from "@/components/ui/members/member-container" ;
12+ import { PageContainer } from "@/components/ui/page-container" ;
1213
1314export default function MembersPage ( {
1415 params,
@@ -65,7 +66,7 @@ export default function MembersPage({
6566 }
6667
6768 return (
68- < div className = "container mx-auto p-6 space-y-8" >
69+ < PageContainer >
6970 < MemberContainer
7071 users = { users }
7172 relationships = { relationships }
@@ -74,6 +75,6 @@ export default function MembersPage({
7475 isLoading = { isRelationshipsLoading || isUsersLoading }
7576 openAddMemberDialog = { openAddMemberDialog }
7677 />
77- </ div >
78+ </ PageContainer >
7879 ) ;
7980}
Original file line number Diff line number Diff line change 22
33import { useState } from "react" ;
44import type * as React from "react" ;
5- import { cn } from "@/components/lib/utils" ;
65import CoachingSessionList from "@/components/ui/dashboard/coaching-session-list" ;
76import AddEntities from "@/components/ui/dashboard/add-entities" ;
87import { CoachingSessionDialog } from "@/components/ui/dashboard/coaching-session-dialog" ;
@@ -25,18 +24,7 @@ export function DashboardContainer() {
2524 } ;
2625
2726 return (
28- < div
29- className = { cn (
30- // Base styles
31- "p-4" ,
32- // Mobile: stack vertically
33- "flex flex-col gap-6" ,
34- // Never grow wider than the site-header
35- "max-w-screen-2xl" ,
36- // Ensure full width for children
37- "[&>*]:w-full"
38- ) }
39- >
27+ < >
4028 < AddEntities
4129 className = "mb-8"
4230 onCreateSession = { ( ) => handleOpenDialog ( ) }
@@ -47,6 +35,6 @@ export function DashboardContainer() {
4735 onOpenChange = { handleCloseDialog }
4836 coachingSessionToEdit = { sessionToEdit }
4937 />
50- </ div >
38+ </ >
5139 ) ;
5240}
Original file line number Diff line number Diff line change 1+ import { cn } from "@/components/lib/utils" ;
2+
3+ /// A reusable parent page container that contains and provides all children components
4+ /// the right style to adhere to the right max width and padding from the sidebar.
5+ export function PageContainer ( {
6+ children,
7+ } : Readonly < {
8+ children : React . ReactNode ;
9+ } > ) {
10+ return (
11+ < div
12+ className = { cn (
13+ // Base styles
14+ "p-4" ,
15+ // Mobile: stack vertically
16+ "flex flex-col gap-6" ,
17+ // Never grow wider than the site-header
18+ "max-w-screen-2xl" ,
19+ // Ensure full width for children
20+ "[&>*]:w-full"
21+ ) }
22+ >
23+ { children }
24+ </ div >
25+ ) ;
26+ }
You can’t perform that action at this time.
0 commit comments