From 283ef1ee4079bccb3c21d9f206ea9f82e6ce5bc2 Mon Sep 17 00:00:00 2001 From: Yared Yemane Date: Sat, 8 Aug 2026 11:50:48 +0300 Subject: [PATCH] Enable admin team invites, hide practice points/difficulty UI, and improve mobile layout. Co-authored-by: Cursor --- src/components/access/AdminAccessGates.tsx | 2 +- src/components/admin/AdminTableContainer.tsx | 12 ++- src/components/filters/AdminFiltersPanel.tsx | 4 +- src/components/ui/dialog.tsx | 2 +- src/components/ui/stepper.tsx | 96 ++++++++++++------- src/components/ui/table.tsx | 6 +- src/layouts/AppLayout.tsx | 15 ++- src/lib/adminAccess.ts | 2 +- src/lib/practiceEditDirty.ts | 6 +- src/lib/practiceFullMapper.ts | 6 +- .../content-management/AddPracticeFlow.tsx | 24 ++--- src/pages/content-management/AddVideoFlow.tsx | 14 +-- .../content-management/AttachPracticeFlow.tsx | 26 ++--- .../AttachProgramPracticeFlow.tsx | 22 ++--- .../ContentManagementLayout.tsx | 10 +- .../CreateQuestionTypeFlow.tsx | 16 ++-- .../content-management/EditPracticeFlow.tsx | 40 ++++---- .../LinkExistingPracticeFlow.tsx | 20 ++-- .../AttachPracticeReviewStep.tsx | 14 +-- .../practice-steps/AttachPracticeStep1.tsx | 4 +- .../components/practice-steps/ContextStep.tsx | 4 +- .../components/practice-steps/PersonaStep.tsx | 6 +- .../ProgramAttachReviewStep.tsx | 6 +- .../practice-steps/ProgramAttachStep1.tsx | 4 +- .../practice-steps/QuestionsStep.tsx | 65 +------------ .../SelectPracticeToAttachStep.tsx | 10 +- .../QuestionTypeStepFooter.tsx | 8 +- src/pages/role-management/RolesListPage.tsx | 2 +- src/pages/settings/AppVersionsTab.tsx | 2 +- src/pages/settings/SubscriptionPlansTab.tsx | 2 +- src/pages/team/TeamManagementPage.tsx | 2 +- 31 files changed, 214 insertions(+), 238 deletions(-) diff --git a/src/components/access/AdminAccessGates.tsx b/src/components/access/AdminAccessGates.tsx index 561954d..1b84d51 100644 --- a/src/components/access/AdminAccessGates.tsx +++ b/src/components/access/AdminAccessGates.tsx @@ -14,7 +14,7 @@ export function FullPanelOnly({ children, fallback = null }: GateProps) { return <>{children} } -/** Renders children only for Super Admin (e.g. team email invites). */ +/** Renders children only for Admin / Super Admin (e.g. team email invites). */ export function SuperAdminOnly({ children, fallback = null }: GateProps) { const { canInviteTeam } = useAdminAccess() if (!canInviteTeam) return <>{fallback} diff --git a/src/components/admin/AdminTableContainer.tsx b/src/components/admin/AdminTableContainer.tsx index 98d0dc8..8fd7c83 100644 --- a/src/components/admin/AdminTableContainer.tsx +++ b/src/components/admin/AdminTableContainer.tsx @@ -13,8 +13,16 @@ export function AdminTableContainer({ minWidth, }: AdminTableContainerProps) { return ( -
-
+
+
{children}
diff --git a/src/components/filters/AdminFiltersPanel.tsx b/src/components/filters/AdminFiltersPanel.tsx index 7174e9f..392124c 100644 --- a/src/components/filters/AdminFiltersPanel.tsx +++ b/src/components/filters/AdminFiltersPanel.tsx @@ -47,7 +47,9 @@ export function AdminFiltersPanel({ )} >
- {search ?
{search}
: null} + {search ? ( +
{search}
+ ) : null} {inlineActions ? (
{actions}
) : ( diff --git a/src/components/ui/dialog.tsx b/src/components/ui/dialog.tsx index 37110f9..2a9c831 100644 --- a/src/components/ui/dialog.tsx +++ b/src/components/ui/dialog.tsx @@ -32,7 +32,7 @@ const DialogContent = React.forwardRef< - {steps.map((step, index) => { - const stepNumber = index + 1; - const isCurrent = stepNumber === currentStep; +
+ {/* Compact mobile summary */} +
+

+ {currentLabel} +

+

+ Step {safeCurrent} of {steps.length} +

+
- return ( -
- {/* Connector Line - floats between circles with gap on both sides */} - {index < steps.length - 1 && ( -
- )} +
+ {steps.map((step, index) => { + const stepNumber = index + 1; + const isCurrent = stepNumber === safeCurrent; + const isComplete = stepNumber < safeCurrent; - {/* Circle */} + return (
- {stepNumber} -
+ {index < steps.length - 1 ? ( +
+ ) : null} - {/* Label */} - - {step} - -
- ); - })} +
+ {stepNumber} +
+ + +
+ ); + })} +
); } diff --git a/src/components/ui/table.tsx b/src/components/ui/table.tsx index 32ed567..533918a 100644 --- a/src/components/ui/table.tsx +++ b/src/components/ui/table.tsx @@ -12,7 +12,7 @@ export const Table = React.forwardRef( ) if (noWrapper) return table - return
{table}
+ return
{table}
}, ) Table.displayName = "Table" @@ -53,7 +53,7 @@ export const TableHead = React.forwardRef (
), @@ -62,7 +62,7 @@ TableHead.displayName = "TableHead" export const TableCell = React.forwardRef>( ({ className, ...props }, ref) => ( - + ), ) TableCell.displayName = "TableCell" diff --git a/src/layouts/AppLayout.tsx b/src/layouts/AppLayout.tsx index 2814c22..1189891 100644 --- a/src/layouts/AppLayout.tsx +++ b/src/layouts/AppLayout.tsx @@ -38,6 +38,15 @@ export function AppLayout() { setSidebarOpen(false) }, []) + useEffect(() => { + if (!sidebarOpen) return + const previous = document.body.style.overflow + document.body.style.overflow = "hidden" + return () => { + document.body.style.overflow = previous + } + }, [sidebarOpen]) + useEffect(() => { const container = mainRef.current if (!container) return @@ -100,8 +109,8 @@ export function AppLayout() { > -