Enable admin team invites, hide practice points/difficulty UI, and improve mobile layout.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Yared Yemane 2026-08-08 11:50:48 +03:00
parent 72384a5980
commit 283ef1ee40
31 changed files with 214 additions and 238 deletions

View File

@ -14,7 +14,7 @@ export function FullPanelOnly({ children, fallback = null }: GateProps) {
return <>{children}</> 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) { export function SuperAdminOnly({ children, fallback = null }: GateProps) {
const { canInviteTeam } = useAdminAccess() const { canInviteTeam } = useAdminAccess()
if (!canInviteTeam) return <>{fallback}</> if (!canInviteTeam) return <>{fallback}</>

View File

@ -13,8 +13,16 @@ export function AdminTableContainer({
minWidth, minWidth,
}: AdminTableContainerProps) { }: AdminTableContainerProps) {
return ( return (
<div className={cn("min-w-0 overflow-x-auto rounded-lg border border-grayScale-100", className)}> <div
<div style={minWidth ? { minWidth } : undefined} className={minWidth ? undefined : "min-w-0"}> className={cn(
"min-w-0 overflow-x-auto overscroll-x-contain rounded-lg border border-grayScale-100 [-webkit-overflow-scrolling:touch]",
className,
)}
>
<div
style={minWidth ? { minWidth } : undefined}
className={minWidth ? "inline-block min-w-full align-middle" : "min-w-0"}
>
{children} {children}
</div> </div>
</div> </div>

View File

@ -47,7 +47,9 @@ export function AdminFiltersPanel({
)} )}
> >
<div className="flex flex-wrap items-center gap-3 p-4"> <div className="flex flex-wrap items-center gap-3 p-4">
{search ? <div className="min-w-[200px] flex-1">{search}</div> : null} {search ? (
<div className="min-w-0 w-full flex-1 sm:min-w-[200px]">{search}</div>
) : null}
{inlineActions ? ( {inlineActions ? (
<div className="h-9 shrink-0">{actions}</div> <div className="h-9 shrink-0">{actions}</div>
) : ( ) : (

View File

@ -32,7 +32,7 @@ const DialogContent = React.forwardRef<
<DialogPrimitive.Content <DialogPrimitive.Content
ref={ref} ref={ref}
className={cn( className={cn(
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-border bg-card p-6 text-card-foreground shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg", "fixed left-[50%] top-[50%] z-50 grid w-[calc(100%-1.5rem)] max-w-lg max-h-[min(90dvh,calc(100dvh-2rem))] translate-x-[-50%] translate-y-[-50%] gap-4 overflow-y-auto overscroll-contain border border-border bg-card p-4 text-card-foreground shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg sm:w-full sm:p-6",
className, className,
)} )}
{...props} {...props}

View File

@ -7,42 +7,63 @@ export interface StepperProps {
} }
export function Stepper({ steps, currentStep, className }: StepperProps) { export function Stepper({ steps, currentStep, className }: StepperProps) {
const safeCurrent = Math.min(Math.max(currentStep, 1), Math.max(steps.length, 1));
const currentLabel = steps[safeCurrent - 1] ?? "";
return ( return (
<div className={cn("flex w-full items-start justify-between", className)}> <div className={cn("w-full min-w-0", className)}>
{/* Compact mobile summary */}
<div className="mb-3 flex items-center justify-between gap-3 sm:hidden">
<p className="min-w-0 truncate text-sm font-semibold text-brand-600">
{currentLabel}
</p>
<p className="shrink-0 text-xs font-medium text-grayScale-400">
Step {safeCurrent} of {steps.length}
</p>
</div>
<div className="flex w-full min-w-0 items-start justify-between gap-1 sm:gap-0">
{steps.map((step, index) => { {steps.map((step, index) => {
const stepNumber = index + 1; const stepNumber = index + 1;
const isCurrent = stepNumber === currentStep; const isCurrent = stepNumber === safeCurrent;
const isComplete = stepNumber < safeCurrent;
return ( return (
<div <div
key={step} key={`${step}-${stepNumber}`}
className="flex-1 relative flex flex-col items-center group" className="relative flex min-w-0 flex-1 flex-col items-center"
> >
{/* Connector Line - floats between circles with gap on both sides */} {index < steps.length - 1 ? (
{index < steps.length - 1 && (
<div
className="absolute top-4 h-[1.5px] bg-grayScale-200 dark:bg-grayScale-300 z-0"
style={{ left: "calc(50% + 50px)", right: "calc(-50% + 50px)" }}
/>
)}
{/* Circle */}
<div <div
className={cn( className={cn(
"relative z-10 grid h-8 w-8 place-items-center rounded-full border-2 text-sm font-bold transition-all duration-300 mb-3", "absolute top-3.5 z-0 h-[1.5px] sm:top-4",
isCurrent isComplete ? "bg-brand-400" : "bg-grayScale-200 dark:bg-grayScale-300",
? "border-brand-500 bg-brand-500 text-white shadow-md scale-110"
: "border-grayScale-100 dark:border-grayScale-300 bg-white dark:bg-grayScale-100 text-grayScale-400 dark:text-grayScale-500 font-medium",
)} )}
style={{ left: "calc(50% + 1rem)", right: "calc(-50% + 1rem)" }}
aria-hidden
/>
) : null}
<div
className={cn(
"relative z-10 mb-2 grid h-7 w-7 place-items-center rounded-full border-2 text-xs font-bold transition-all duration-300 sm:mb-3 sm:h-8 sm:w-8 sm:text-sm",
isCurrent
? "scale-105 border-brand-500 bg-brand-500 text-white shadow-md sm:scale-110"
: isComplete
? "border-brand-400 bg-brand-50 text-brand-600"
: "border-grayScale-100 bg-white font-medium text-grayScale-400 dark:border-grayScale-300 dark:bg-grayScale-100 dark:text-grayScale-500",
)}
aria-current={isCurrent ? "step" : undefined}
> >
{stepNumber} {stepNumber}
</div> </div>
{/* Label */}
<span <span
className={cn( className={cn(
"relative z-10 text-[12px] font-bold transition-colors duration-300", "relative z-10 hidden max-w-full px-0.5 text-center text-[11px] font-bold leading-tight transition-colors duration-300 sm:line-clamp-2 sm:block sm:text-[12px]",
isCurrent ? "text-brand-500" : "text-grayScale-400 dark:text-grayScale-500 font-medium", isCurrent
? "text-brand-500"
: "font-medium text-grayScale-400 dark:text-grayScale-500",
)} )}
> >
{step} {step}
@ -51,5 +72,6 @@ export function Stepper({ steps, currentStep, className }: StepperProps) {
); );
})} })}
</div> </div>
</div>
); );
} }

View File

@ -12,7 +12,7 @@ export const Table = React.forwardRef<HTMLTableElement, TableProps>(
<table ref={ref} className={cn("w-full caption-bottom text-sm", className)} {...props} /> <table ref={ref} className={cn("w-full caption-bottom text-sm", className)} {...props} />
) )
if (noWrapper) return table if (noWrapper) return table
return <div className="relative w-full min-w-0 overflow-auto">{table}</div> return <div className="relative w-full min-w-0 overflow-auto overscroll-x-contain [-webkit-overflow-scrolling:touch]">{table}</div>
}, },
) )
Table.displayName = "Table" Table.displayName = "Table"
@ -53,7 +53,7 @@ export const TableHead = React.forwardRef<HTMLTableCellElement, React.ThHTMLAttr
({ className, ...props }, ref) => ( ({ className, ...props }, ref) => (
<th <th
ref={ref} ref={ref}
className={cn("h-11 px-4 text-left align-middle text-xs font-semibold text-grayScale-500 [&:has([role=checkbox])]:pr-0", className)} className={cn("h-11 px-3 text-left align-middle text-xs font-semibold text-grayScale-500 sm:px-4 [&:has([role=checkbox])]:pr-0", className)}
{...props} {...props}
/> />
), ),
@ -62,7 +62,7 @@ TableHead.displayName = "TableHead"
export const TableCell = React.forwardRef<HTMLTableCellElement, React.TdHTMLAttributes<HTMLTableCellElement>>( export const TableCell = React.forwardRef<HTMLTableCellElement, React.TdHTMLAttributes<HTMLTableCellElement>>(
({ className, ...props }, ref) => ( ({ className, ...props }, ref) => (
<td ref={ref} className={cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className)} {...props} /> <td ref={ref} className={cn("p-3 align-middle sm:p-4 [&:has([role=checkbox])]:pr-0", className)} {...props} />
), ),
) )
TableCell.displayName = "TableCell" TableCell.displayName = "TableCell"

View File

@ -38,6 +38,15 @@ export function AppLayout() {
setSidebarOpen(false) 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(() => { useEffect(() => {
const container = mainRef.current const container = mainRef.current
if (!container) return if (!container) return
@ -100,8 +109,8 @@ export function AppLayout() {
> >
<Outlet /> <Outlet />
</main> </main>
<footer className="shrink-0 border-t bg-grayScale-50 px-4 py-3 lg:px-6"> <footer className="shrink-0 border-t bg-grayScale-50 px-3 py-2.5 sm:px-4 sm:py-3 lg:px-6">
<div className="flex items-center justify-center gap-1.5 text-xs text-grayScale-400"> <div className="flex flex-wrap items-center justify-center gap-x-1.5 gap-y-0.5 text-[11px] text-grayScale-400 sm:text-xs">
<span>Powered by</span> <span>Powered by</span>
<a <a
href="https://yimaruacademy.com" href="https://yimaruacademy.com"
@ -111,7 +120,7 @@ export function AppLayout() {
> >
Yimaru Academy Yimaru Academy
</a> </a>
<span>·</span> <span aria-hidden>·</span>
<span>© {new Date().getFullYear()}</span> <span>© {new Date().getFullYear()}</span>
</div> </div>
</footer> </footer>

View File

@ -29,7 +29,7 @@ export function isContentManagerRole(role?: string): boolean {
} }
export function canSendTeamInvitations(role?: string): boolean { export function canSendTeamInvitations(role?: string): boolean {
return normalizedTeamRole(role) === "SUPER_ADMIN" return FULL_PANEL_TEAM_ROLES.has(normalizedTeamRole(role))
} }
export function isPathAllowedForTeamRole(pathname: string, role?: string): boolean { export function isPathAllowedForTeamRole(pathname: string, role?: string): boolean {

View File

@ -20,8 +20,10 @@ function normalizeQuestionRow(question: PracticeFormState["questions"][number])
stimulusBlockKey: question.stimulusBlockKey ?? null, stimulusBlockKey: question.stimulusBlockKey ?? null,
questionTypeDefinitionId: question.questionTypeDefinitionId ?? null, questionTypeDefinitionId: question.questionTypeDefinitionId ?? null,
text: String(question.text ?? "").trim(), text: String(question.text ?? "").trim(),
difficultyLevel: question.difficultyLevel, difficultyLevel: question.difficultyLevel ?? "EASY",
points: Number(question.points), points: Number.isFinite(Number(question.points)) && Number(question.points) > 0
? Number(question.points)
: 1,
dynamicFieldValues: question.dynamicFieldValues ?? {}, dynamicFieldValues: question.dynamicFieldValues ?? {},
mcqOptions: (question.mcqOptions ?? []).map((option) => ({ mcqOptions: (question.mcqOptions ?? []).map((option) => ({
text: String(option.text ?? "").trim(), text: String(option.text ?? "").trim(),

View File

@ -56,8 +56,8 @@ export interface PracticeFormQuestionRow {
stimulusBlockKey: string | null stimulusBlockKey: string | null
questionTypeDefinitionId: number | null questionTypeDefinitionId: number | null
text: string text: string
difficultyLevel: "EASY" | "MEDIUM" | "HARD" difficultyLevel?: "EASY" | "MEDIUM" | "HARD"
points: number points?: number
dynamicFieldValues: Record<string, string> dynamicFieldValues: Record<string, string>
sourceDynamicPayload?: DynamicQuestionPayload | null sourceDynamicPayload?: DynamicQuestionPayload | null
mcqOptions: { text: string; isCorrect: boolean }[] mcqOptions: { text: string; isCorrect: boolean }[]
@ -641,8 +641,6 @@ export function mapPracticeFullToFormState(
stimulusBlockKey: null, stimulusBlockKey: null,
questionTypeDefinitionId: typeDefinitions[0]?.id ?? null, questionTypeDefinitionId: typeDefinitions[0]?.id ?? null,
text: "", text: "",
difficultyLevel: "EASY" as const,
points: 1,
dynamicFieldValues: typeDefinitions[0] dynamicFieldValues: typeDefinitions[0]
? emptyDynamicFieldValuesForDefinition(typeDefinitions[0]) ? emptyDynamicFieldValuesForDefinition(typeDefinitions[0])
: {}, : {},

View File

@ -243,8 +243,6 @@ export function AddPracticeFlow() {
stimulusBlockKey: null as string | null, stimulusBlockKey: null as string | null,
questionTypeDefinitionId: null as number | null, questionTypeDefinitionId: null as number | null,
text: "", text: "",
difficultyLevel: "EASY" as "EASY" | "MEDIUM" | "HARD",
points: 1,
dynamicFieldValues: {} as Record<string, string>, dynamicFieldValues: {} as Record<string, string>,
mcqOptions: [ mcqOptions: [
{ text: "", isCorrect: true }, { text: "", isCorrect: true },
@ -576,8 +574,6 @@ export function AddPracticeFlow() {
questionTypeDefinitionId: questionTypeDefinitionId:
typeDefinitions[0]?.id ?? (null as number | null), typeDefinitions[0]?.id ?? (null as number | null),
text: "", text: "",
difficultyLevel: "EASY" as "EASY" | "MEDIUM" | "HARD",
points: 1,
dynamicFieldValues: typeDefinitions[0] dynamicFieldValues: typeDefinitions[0]
? emptyDynamicFieldValuesForDefinition(typeDefinitions[0]) ? emptyDynamicFieldValuesForDefinition(typeDefinitions[0])
: {}, : {},
@ -750,26 +746,26 @@ export function AddPracticeFlow() {
}; };
return ( return (
<div className="space-y-8 px-6 pb-16 pt-6"> <div className="space-y-6 px-0 pb-12 pt-2 sm:space-y-8 sm:px-2 sm:pb-16 sm:pt-4">
<div className="mx-auto max-w-7xl w-full"> <div className="mx-auto w-full max-w-7xl min-w-0">
<div className="flex items-center justify-between mb-8"> <div className="mb-6 flex items-center justify-between sm:mb-8">
<PageBackLink fallbackTo={backPath} label={backLabel} /> <PageBackLink fallbackTo={backPath} label={backLabel} />
</div> </div>
<div className=" mb-10"> <div className="mb-8 sm:mb-10">
<div className="flex items-center justify-between"> <div className="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between sm:gap-4">
<h1 className="text-3xl font-bold text-[#0F172A]"> <h1 className="text-2xl font-bold text-[#0F172A] sm:text-3xl">
{isFromQuestionType ? "Create Practice from Question Type" : "Add New Practice"} {isFromQuestionType ? "Create Practice from Question Type" : "Add New Practice"}
</h1> </h1>
<Button <Button
variant="outline" variant="outline"
className="rounded-[8px] border-grayScale-200 text-grayScale-600 h-10 px-6 font-bold bg-white hover:bg-grayScale-50" className="h-10 w-full rounded-[8px] border-grayScale-200 bg-white px-6 font-bold text-grayScale-600 hover:bg-grayScale-50 sm:w-auto"
onClick={goBack} onClick={goBack}
> >
Cancel Cancel
</Button> </Button>
</div> </div>
<p className="text-grayScale-400 text-base"> <p className="mt-1 text-sm text-grayScale-400 sm:text-base">
{isFromQuestionType {isFromQuestionType
? `Build a practice using ${seededQuestionType?.display_name ?? "the selected question type"}. Locations are optional — attach courses, modules, or lessons later.` ? `Build a practice using ${seededQuestionType?.display_name ?? "the selected question type"}. Locations are optional — attach courses, modules, or lessons later.`
: "Create a practice with story details, a persona, and questions from your question type library."} : "Create a practice with story details, a persona, and questions from your question type library."}
@ -813,12 +809,12 @@ export function AddPracticeFlow() {
) : null} ) : null}
</div> </div>
<div className="mx-auto w-[70%] mb-12"> <div className="mx-auto mb-8 w-full max-w-3xl sm:mb-12">
<Stepper steps={[...STEP_LABELS]} currentStep={currentStep} /> <Stepper steps={[...STEP_LABELS]} currentStep={currentStep} />
</div> </div>
<div <div
className={`mx-auto ${currentStep === 3 || currentStep === 4 ? "max-w-6xl" : "max-w-4xl"}`} className={`mx-auto min-w-0 ${currentStep === 3 || currentStep === 4 ? "max-w-6xl" : "max-w-4xl"}`}
> >
{renderStep()} {renderStep()}
</div> </div>

View File

@ -186,31 +186,31 @@ export function AddVideoFlow() {
} }
return ( return (
<div className="space-y-8 pb-32 px-6 pt-6 min-h-screen "> <div className="min-h-screen space-y-6 px-0 pb-24 pt-2 sm:space-y-8 sm:px-2 sm:pb-32 sm:pt-4">
<div className="mx-auto max-w-7xl w-full"> <div className="mx-auto w-full max-w-7xl min-w-0">
<div className="flex items-center justify-between mb-8"> <div className="mb-6 flex flex-col gap-3 sm:mb-8 sm:flex-row sm:items-center sm:justify-between">
<PageBackLink fallbackTo={backPath} label="Back to module" className="text-grayScale-500" /> <PageBackLink fallbackTo={backPath} label="Back to module" className="text-grayScale-500" />
<Button <Button
variant="outline" variant="outline"
className="rounded-[8px] border-grayScale-200 text-grayScale-600 h-10 px-6 font-bold bg-white hover:bg-grayScale-50" className="h-10 w-full rounded-[8px] border-grayScale-200 bg-white px-6 font-bold text-grayScale-600 hover:bg-grayScale-50 sm:w-auto"
onClick={goBack} onClick={goBack}
> >
Cancel Cancel
</Button> </Button>
</div> </div>
<h1 className="text-2xl font-bold text-[#0F172A] mb-10"> <h1 className="mb-8 text-2xl font-bold text-[#0F172A] sm:mb-10">
Add new lesson Add new lesson
</h1> </h1>
<div className="mx-auto max-w-4xl mb-12"> <div className="mx-auto mb-8 w-full max-w-3xl sm:mb-12">
<Stepper <Stepper
steps={STEPS.map((s) => s.label)} steps={STEPS.map((s) => s.label)}
currentStep={currentStep} currentStep={currentStep}
/> />
</div> </div>
<div className="mx-auto max-w-7xl"> <div className="mx-auto min-w-0 max-w-7xl">
{currentStep === 1 && ( {currentStep === 1 && (
<VideoDetailStep <VideoDetailStep
key={formResetKey} key={formResetKey}

View File

@ -145,13 +145,13 @@ export function AttachPracticeFlow() {
: "Verify practice details before publishing it."; : "Verify practice details before publishing it.";
return ( return (
<div className="space-y-8 pb-32 px-6 pt-10 min-h-screen animate-in fade-in duration-500"> <div className="min-h-screen animate-in fade-in space-y-6 px-0 pb-24 pt-4 duration-500 sm:space-y-8 sm:px-2 sm:pb-32 sm:pt-8">
<div className="mx-auto w-full"> <div className="mx-auto w-full min-w-0 max-w-7xl">
{/* Navigation Breadcrumb */} {/* Navigation Breadcrumb */}
<div className="flex items-center justify-between mb-12"> <div className="mb-8 flex items-center justify-between sm:mb-12">
<Link <Link
to={backPath} to={backPath}
className="flex items-center gap-2 text-[15px] font-bold text-grayScale-600 transition-colors hover:text-brand-500 group" className="group flex items-center gap-2 text-[15px] font-bold text-grayScale-600 transition-colors hover:text-brand-500"
> >
<ArrowLeft className="h-5 w-5 transition-transform group-hover:-translate-x-1" /> <ArrowLeft className="h-5 w-5 transition-transform group-hover:-translate-x-1" />
Back to Videos Back to Videos
@ -159,34 +159,34 @@ export function AttachPracticeFlow() {
</div> </div>
{/* Stepper Area */} {/* Stepper Area */}
<div className="mb-20 w-full pointer-events-none"> <div className="pointer-events-none mb-10 w-full max-w-3xl sm:mb-16">
<Stepper steps={steps} currentStep={currentStep} /> <Stepper steps={steps} currentStep={currentStep} />
</div> </div>
{/* Page Title & Header Actions */} {/* Page Title & Header Actions */}
<div className="mb-10 flex items-start justify-between"> <div className="mb-8 flex flex-col gap-4 sm:mb-10 sm:flex-row sm:items-start sm:justify-between">
<div className=""> <div className="min-w-0">
<h1 className="text-[30px] font-bold text-[#0D1421] ">{title}</h1> <h1 className="text-2xl font-bold text-[#0D1421] sm:text-[30px]">{title}</h1>
<p className="text-grayScale-400 text-[16px] font-medium "> <p className="text-sm font-medium text-grayScale-400 sm:text-[16px]">
{description} {description}
</p> </p>
</div> </div>
<div className="flex items-center gap-3"> <div className="flex w-full flex-col-reverse gap-2 sm:w-auto sm:flex-row sm:items-center sm:gap-3">
<Button <Button
variant="outline" variant="outline"
className="h-10 px-8 rounded-[6px] border-grayScale-100 text-grayScale-600 font-bold bg-white hover:bg-grayScale-50 shadow-sm" className="h-10 w-full rounded-[6px] border-grayScale-100 bg-white px-8 font-bold text-grayScale-600 shadow-sm hover:bg-grayScale-50 sm:w-auto"
onClick={() => navigate(backPath)} onClick={() => navigate(backPath)}
> >
Cancel Cancel
</Button> </Button>
<Button className="h-10 px-8 rounded-[6px] bg-[#9E2891] font-bold text-white shadow-md hover:bg-[#8A237E] transition-all"> <Button className="h-10 w-full rounded-[6px] bg-[#9E2891] px-8 font-bold text-white shadow-md transition-all hover:bg-[#8A237E] sm:w-auto">
Save as Draft Save as Draft
</Button> </Button>
</div> </div>
</div> </div>
{/* Form Content */} {/* Form Content */}
<div className="w-full">{renderStep()}</div> <div className="w-full min-w-0">{renderStep()}</div>
</div> </div>
</div> </div>
); );

View File

@ -105,13 +105,13 @@ export function AttachProgramPracticeFlow() {
: "Verify practice details before publishing it."; : "Verify practice details before publishing it.";
return ( return (
<div className="space-y-8 px-6 pt-10 min-h-screen animate-in fade-in duration-500"> <div className="min-h-screen animate-in fade-in space-y-6 px-0 pt-4 duration-500 sm:space-y-8 sm:px-2 sm:pt-8">
<div className=" w-full"> <div className="mx-auto w-full min-w-0 max-w-7xl">
{/* Navigation Breadcrumb */} {/* Navigation Breadcrumb */}
<div className="flex items-center justify-between mb-12"> <div className="mb-8 flex items-center justify-between sm:mb-12">
<Link <Link
to={backPath} to={backPath}
className="flex items-center gap-2 text-[15px] font-bold text-grayScale-600 transition-colors hover:text-brand-500 group" className="group flex items-center gap-2 text-[15px] font-bold text-grayScale-600 transition-colors hover:text-brand-500"
> >
<ArrowLeft className="h-5 w-5 transition-transform group-hover:-translate-x-1" /> <ArrowLeft className="h-5 w-5 transition-transform group-hover:-translate-x-1" />
Back to Program Back to Program
@ -119,20 +119,20 @@ export function AttachProgramPracticeFlow() {
</div> </div>
{/* Stepper Area */} {/* Stepper Area */}
<div className="mb-20 pointer-events-none"> <div className="pointer-events-none mb-10 max-w-3xl sm:mb-16">
<Stepper steps={steps} currentStep={currentStep} /> <Stepper steps={steps} currentStep={currentStep} />
</div> </div>
{/* Page Title & Header Actions */} {/* Page Title & Header Actions */}
<div className="mb-10 flex items-start justify-between"> <div className="mb-8 flex flex-col gap-4 sm:mb-10 sm:flex-row sm:items-start sm:justify-between">
<div className=""> <div className="min-w-0">
<h1 className="text-[30px] font-bold text-[#0D1421] ">{title}</h1> <h1 className="text-2xl font-bold text-[#0D1421] sm:text-[30px]">{title}</h1>
<p className="text-grayScale-500 text-[14px]">{description}</p> <p className="text-sm text-grayScale-500 sm:text-[14px]">{description}</p>
</div> </div>
<div className="flex items-center gap-3"> <div className="flex w-full flex-col-reverse gap-2 sm:w-auto sm:flex-row sm:items-center sm:gap-3">
<Button <Button
variant="outline" variant="outline"
className="h-10 px-8 rounded-[6px] border-grayScale-100 text-grayScale-600 font-bold bg-white hover:bg-grayScale-50 shadow-sm" className="h-10 w-full rounded-[6px] border-grayScale-100 bg-white px-8 font-bold text-grayScale-600 shadow-sm hover:bg-grayScale-50 sm:w-auto"
onClick={() => navigate(backPath)} onClick={() => navigate(backPath)}
> >
Cancel Cancel

View File

@ -3,11 +3,11 @@ import { Outlet } from "react-router-dom";
export function ContentManagementLayout() { export function ContentManagementLayout() {
return ( return (
<div className="mx-auto w-full min-w-0 max-w-7xl px-0 py-4 sm:px-4 sm:py-6 lg:px-6"> <div className="mx-auto w-full min-w-0 max-w-7xl px-0 py-4 sm:px-4 sm:py-6 lg:px-6">
<div className="mb-8"> <div className="mb-6 sm:mb-8">
<div className="mb-8 flex items-center gap-3"> <div className="mb-6 flex items-center gap-3 sm:mb-8">
<div className="h-9 w-1 rounded-full bg-gradient-to-b from-brand-500 to-brand-600" /> <div className="h-9 w-1 shrink-0 rounded-full bg-gradient-to-b from-brand-500 to-brand-600" />
<div> <div className="min-w-0">
<h1 className="text-2xl font-bold tracking-tight text-grayScale-900 sm:text-[1.65rem]"> <h1 className="text-xl font-bold tracking-tight text-grayScale-900 sm:text-2xl sm:text-[1.65rem]">
Content Management Content Management
</h1> </h1>
<p className="mt-1 max-w-2xl text-sm leading-relaxed text-grayScale-500"> <p className="mt-1 max-w-2xl text-sm leading-relaxed text-grayScale-500">

View File

@ -346,7 +346,7 @@ export function CreateQuestionTypeFlow() {
<div className="min-h-screen pb-20 overflow-x-hidden"> <div className="min-h-screen pb-20 overflow-x-hidden">
<div className=" border-b border-grayScale-100 sticky top-0 z-50 bg-white/95 dark:bg-grayScale-50 backdrop-blur"> <div className=" border-b border-grayScale-100 sticky top-0 z-50 bg-white/95 dark:bg-grayScale-50 backdrop-blur">
<div className="max-w-[1440px] mx-auto py-6 px-4 sm:px-6"> <div className="max-w-[1440px] mx-auto py-6 px-4 sm:px-6">
<div className="flex items-center justify-between mb-8"> <div className="mb-6 flex items-center justify-between sm:mb-8">
<PageBackLink <PageBackLink
fallbackTo="/new-content/question-types" fallbackTo="/new-content/question-types"
label="Back to Question Type Library" label="Back to Question Type Library"
@ -354,27 +354,27 @@ export function CreateQuestionTypeFlow() {
/> />
</div> </div>
<div className="flex flex-col lg:flex-row lg:items-start lg:justify-between gap-6"> <div className="flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between lg:gap-6">
<div className="space-y-1"> <div className="min-w-0 space-y-1">
<h1 className="text-[28px] font-bold text-grayScale-900 dark:text-grayScale-600 tracking-tight"> <h1 className="text-2xl font-bold tracking-tight text-grayScale-900 dark:text-grayScale-600 sm:text-[28px]">
{isEdit ? "Edit question type definition" : "Create question type definition"} {isEdit ? "Edit question type definition" : "Create question type definition"}
</h1> </h1>
<p className="text-grayScale-500 dark:text-grayScale-400 text-[14px] font-medium max-w-2xl"> <p className="max-w-2xl text-[14px] font-medium text-grayScale-500 dark:text-grayScale-400">
{isEdit {isEdit
? `Update reusable question type definition #${editDefinitionId}.` ? `Update reusable question type definition #${editDefinitionId}.`
: "Build a reusable question type template for dynamic practice and assessment questions."} : "Build a reusable question type template for dynamic practice and assessment questions."}
</p> </p>
</div> </div>
<div className="flex items-center gap-4 shrink-0"> <div className="flex w-full flex-col-reverse gap-2 sm:flex-row sm:items-center sm:gap-3 lg:w-auto lg:shrink-0">
<Button <Button
variant="outline" variant="outline"
className="h-10 px-8 rounded-[6px] border-grayScale-200 text-grayScale-900 dark:text-grayScale-600 font-medium hover:bg-grayScale-50 dark:hover:bg-grayScale-100" className="h-10 w-full rounded-[6px] border-grayScale-200 px-8 font-medium text-grayScale-900 hover:bg-grayScale-50 dark:text-grayScale-600 dark:hover:bg-grayScale-100 sm:w-auto"
onClick={() => navigate("/new-content/question-types")} onClick={() => navigate("/new-content/question-types")}
> >
Cancel Cancel
</Button> </Button>
<Button <Button
className="h-10 px-8 rounded-[6px] bg-[#9E2891] font-medium text-white shadow-lg shadow-brand-500/10 hover:bg-[#8A237E] transition-all" className="h-10 w-full rounded-[6px] bg-[#9E2891] px-8 font-medium text-white shadow-lg shadow-brand-500/10 transition-all hover:bg-[#8A237E] sm:w-auto"
onClick={() => void handleHeaderSaveDraft()} onClick={() => void handleHeaderSaveDraft()}
disabled={saving || (isEdit && !hasUnsavedChanges)} disabled={saving || (isEdit && !hasUnsavedChanges)}
> >

View File

@ -280,8 +280,6 @@ export function EditPracticeFlow() {
stimulusBlockKey: null as string | null, stimulusBlockKey: null as string | null,
questionTypeDefinitionId: null as number | null, questionTypeDefinitionId: null as number | null,
text: "", text: "",
difficultyLevel: "EASY" as "EASY" | "MEDIUM" | "HARD",
points: 1,
dynamicFieldValues: {} as Record<string, string>, dynamicFieldValues: {} as Record<string, string>,
mcqOptions: [ mcqOptions: [
{ text: "", isCorrect: true }, { text: "", isCorrect: true },
@ -740,18 +738,26 @@ export function EditPracticeFlow() {
}; };
return ( return (
<div className="space-y-8 px-6 pb-16 pt-6"> <div className="space-y-6 px-0 pb-12 pt-2 sm:space-y-8 sm:px-2 sm:pb-16 sm:pt-4">
<div className="mx-auto max-w-7xl w-full"> <div className="mx-auto w-full max-w-7xl min-w-0">
<div className="flex items-center justify-between mb-8"> <div className="mb-6 flex items-center justify-between sm:mb-8">
<PageBackLink fallbackTo={backPath} label={backLabel} /> <PageBackLink fallbackTo={backPath} label={backLabel} />
</div> </div>
<div className="mb-10"> <div className="mb-8 sm:mb-10">
<div className="flex items-center justify-between gap-4"> <div className="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between sm:gap-4">
<h1 className="text-3xl font-bold text-[#0F172A]">Edit Practice</h1> <h1 className="text-2xl font-bold text-[#0F172A] sm:text-3xl">Edit Practice</h1>
<div className="flex shrink-0 items-center gap-3"> <div className="flex w-full flex-col-reverse gap-2 sm:w-auto sm:flex-row sm:items-center sm:gap-3">
<Button <Button
className="h-10 rounded-[8px] bg-brand-500 px-6 font-bold text-white shadow-md shadow-brand-500/20 hover:bg-brand-600 disabled:opacity-50" variant="outline"
className="h-10 w-full rounded-[8px] border-grayScale-200 bg-white px-6 font-bold text-grayScale-600 hover:bg-grayScale-50 sm:w-auto"
disabled={submitting}
onClick={() => goBack()}
>
Cancel
</Button>
<Button
className="h-10 w-full rounded-[8px] bg-brand-500 px-6 font-bold text-white shadow-md shadow-brand-500/20 hover:bg-brand-600 disabled:opacity-50 sm:w-auto"
disabled={submitting || !hasUnsavedChanges} disabled={submitting || !hasUnsavedChanges}
onClick={handleSaveChanges} onClick={handleSaveChanges}
> >
@ -764,27 +770,19 @@ export function EditPracticeFlow() {
"Save changes" "Save changes"
)} )}
</Button> </Button>
<Button
variant="outline"
className="h-10 rounded-[8px] border-grayScale-200 bg-white px-6 font-bold text-grayScale-600 hover:bg-grayScale-50"
disabled={submitting}
onClick={() => goBack()}
>
Cancel
</Button>
</div> </div>
</div> </div>
<p className="text-grayScale-400 text-base"> <p className="mt-1 text-sm text-grayScale-400 sm:text-base">
Update story details, persona, and questions for practice #{practiceId}. Update story details, persona, and questions for practice #{practiceId}.
</p> </p>
</div> </div>
<div className="mx-auto w-[70%] mb-12"> <div className="mx-auto mb-8 w-full max-w-3xl sm:mb-12">
<Stepper steps={[...STEP_LABELS]} currentStep={currentStep} /> <Stepper steps={[...STEP_LABELS]} currentStep={currentStep} />
</div> </div>
<div <div
className={`mx-auto ${currentStep === 3 || currentStep === 4 ? "max-w-6xl" : "max-w-4xl"}`} className={`mx-auto min-w-0 ${currentStep === 3 || currentStep === 4 ? "max-w-6xl" : "max-w-4xl"}`}
> >
{renderStep()} {renderStep()}
</div> </div>

View File

@ -252,24 +252,24 @@ export function LinkExistingPracticeFlow() {
} }
return ( return (
<div className="space-y-8 px-6 pb-16 pt-6"> <div className="space-y-6 px-0 pb-12 pt-2 sm:space-y-8 sm:px-2 sm:pb-16 sm:pt-4">
<div className="mx-auto w-full max-w-7xl"> <div className="mx-auto w-full max-w-7xl min-w-0">
<div className="mb-8 flex items-center justify-between"> <div className="mb-6 flex items-center justify-between sm:mb-8">
<PageBackLink fallbackTo={backPath} label={backLabel} /> <PageBackLink fallbackTo={backPath} label={backLabel} />
</div> </div>
<div className="mb-10"> <div className="mb-8 sm:mb-10">
<div className="flex items-center justify-between"> <div className="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between sm:gap-4">
<h1 className="text-3xl font-bold text-[#0F172A]">Attach Existing Practice</h1> <h1 className="text-2xl font-bold text-[#0F172A] sm:text-3xl">Attach Existing Practice</h1>
<Button <Button
variant="outline" variant="outline"
className="h-10 rounded-[8px] border-grayScale-200 bg-white px-6 font-bold text-grayScale-600 hover:bg-grayScale-50" className="h-10 w-full rounded-[8px] border-grayScale-200 bg-white px-6 font-bold text-grayScale-600 hover:bg-grayScale-50 sm:w-auto"
onClick={goBack} onClick={goBack}
> >
Cancel Cancel
</Button> </Button>
</div> </div>
<p className="text-base text-grayScale-400"> <p className="mt-1 text-sm text-grayScale-400 sm:text-base">
Browse your practice library and link an existing practice to this content location. Browse your practice library and link an existing practice to this content location.
</p> </p>
<div className="mt-4 rounded-xl border border-violet-200 bg-violet-50/80 px-4 py-3 text-sm text-violet-950"> <div className="mt-4 rounded-xl border border-violet-200 bg-violet-50/80 px-4 py-3 text-sm text-violet-950">
@ -287,11 +287,11 @@ export function LinkExistingPracticeFlow() {
</div> </div>
</div> </div>
<div className="mx-auto mb-12 w-[70%] max-w-md"> <div className="mx-auto mb-8 w-full max-w-3xl sm:mb-12">
<Stepper steps={[...STEP_LABELS]} currentStep={currentStep} /> <Stepper steps={[...STEP_LABELS]} currentStep={currentStep} />
</div> </div>
<div className="mx-auto max-w-4xl"> <div className="mx-auto min-w-0 max-w-4xl">
{currentStep === 1 ? ( {currentStep === 1 ? (
<SelectPracticeToAttachStep <SelectPracticeToAttachStep
isExamPrep={isExamPrep} isExamPrep={isExamPrep}

View File

@ -186,18 +186,18 @@ export function AttachPracticeReviewStep({
</div> </div>
{/* 4. Action Footer */} {/* 4. Action Footer */}
<div className="flex items-center justify-between pt-10 px-2"> <div className="flex flex-col-reverse gap-3 px-0 pt-8 sm:flex-row sm:items-center sm:justify-between sm:px-2 sm:pt-10">
<Button <Button
onClick={prevStep} onClick={prevStep}
variant="outline" variant="outline"
className="h-12 px-10 rounded-[6px] bg-transparent border-grayScale-400 font-bold text-grayScale-600 transition-all" className="h-12 w-full rounded-[6px] border-grayScale-400 bg-transparent px-10 font-bold text-grayScale-600 transition-all sm:w-auto"
> >
Back Back
</Button> </Button>
<div className="flex gap-4"> <div className="flex w-full flex-col gap-3 sm:w-auto sm:flex-row sm:gap-4">
<Button <Button
variant="outline" variant="outline"
className="h-12 px-10 rounded-[6px] border-grayScale-200 font-bold text-grayScale-600 bg-white shadow-none transition-all" className="h-12 w-full rounded-[6px] border-grayScale-200 bg-white px-10 font-bold text-grayScale-600 shadow-none transition-all sm:w-auto"
> >
Save as Draft Save as Draft
</Button> </Button>
@ -205,10 +205,10 @@ export function AttachPracticeReviewStep({
onClick={onPublish} onClick={onPublish}
disabled={!isConfirmed} disabled={!isConfirmed}
className={cn( className={cn(
"h-12 px-10 rounded-[6px] font-bold text-white shadow-xl flex items-center gap-3 transition-all active:scale-95", "flex h-12 w-full items-center justify-center gap-3 rounded-[6px] px-10 font-bold text-white shadow-xl transition-all active:scale-95 sm:w-auto",
isConfirmed isConfirmed
? "bg-[#9E2891] hover:bg-[#8A237E] shadow-[#9E2891]/20" ? "bg-[#9E2891] shadow-[#9E2891]/20 hover:bg-[#8A237E]"
: "bg-grayScale-200 cursor-not-allowed opacity-50", : "cursor-not-allowed bg-grayScale-200 opacity-50",
)} )}
> >
<Rocket className="h-5 w-5" /> <Rocket className="h-5 w-5" />

View File

@ -148,7 +148,7 @@ export function AttachPracticeStep1({
</div> </div>
</div> </div>
<div className="flex items-center justify-between border-t border-grayScale-200 bg-[#F8FAFC] py-4 px-12"> <div className="flex flex-col-reverse gap-3 border-t border-grayScale-200 bg-[#F8FAFC] px-4 py-4 sm:flex-row sm:items-center sm:justify-between sm:px-8">
<button <button
className="text-[14px] text-grayScale-500 transition-colors hover:text-grayScale-700" className="text-[14px] text-grayScale-500 transition-colors hover:text-grayScale-700"
onClick={onCancel} onClick={onCancel}
@ -157,7 +157,7 @@ export function AttachPracticeStep1({
</button> </button>
<Button <Button
onClick={nextStep} onClick={nextStep}
className="h-10 px-12 rounded-[6px] bg-[#9E2891] text-[14px] font-bold text-white shadow-lg shadow-brand-500/10 transition-all active:scale-95 flex items-center gap-3" className="flex h-10 w-full items-center justify-center gap-3 rounded-[6px] bg-[#9E2891] px-8 text-[14px] font-bold text-white shadow-lg shadow-brand-500/10 transition-all active:scale-95 sm:w-auto sm:px-12"
> >
Next: Review Next: Review
<ArrowRight className="h-4 w-4" /> <ArrowRight className="h-4 w-4" />

View File

@ -348,7 +348,7 @@ export function ContextStep({
</div> </div>
</div> </div>
<div className="flex items-center justify-between border-t border-grayScale-100 bg-[#F8FAFC] p-4 px-12"> <div className="flex flex-col-reverse gap-3 border-t border-grayScale-100 bg-[#F8FAFC] p-4 sm:flex-row sm:items-center sm:justify-between sm:px-8">
<button <button
type="button" type="button"
className="text-[14px] font-bold text-grayScale-500 transition-colors hover:text-grayScale-700" className="text-[14px] font-bold text-grayScale-500 transition-colors hover:text-grayScale-700"
@ -360,7 +360,7 @@ export function ContextStep({
type="button" type="button"
onClick={nextStep} onClick={nextStep}
disabled={!canContinue} disabled={!canContinue}
className="h-10 px-10 rounded-[6px] bg-brand-500 text-[14px] font-bold text-white transition-all active:scale-95 flex items-center gap-2 disabled:opacity-50" className="flex h-10 w-full items-center justify-center gap-2 rounded-[6px] bg-brand-500 px-8 text-[14px] font-bold text-white transition-all active:scale-95 disabled:opacity-50 sm:w-auto sm:px-10"
> >
Next: Persona <ArrowRight className="h-5 w-5" /> Next: Persona <ArrowRight className="h-5 w-5" />
</Button> </Button>

View File

@ -115,12 +115,12 @@ export function PersonaStep({
</div> </div>
)} )}
<div className="flex items-center justify-between pt-8"> <div className="flex flex-col-reverse gap-3 pt-8 sm:flex-row sm:items-center sm:justify-between">
<Button <Button
type="button" type="button"
onClick={prevStep} onClick={prevStep}
variant="outline" variant="outline"
className="h-10 w-20 rounded-[6px] border-grayScale-200 text-grayScale-600" className="h-10 w-full rounded-[6px] border-grayScale-200 text-grayScale-600 sm:w-20"
> >
Back Back
</Button> </Button>
@ -128,7 +128,7 @@ export function PersonaStep({
type="button" type="button"
onClick={nextStep} onClick={nextStep}
disabled={!selectedPersona || loading || personas.length === 0} disabled={!selectedPersona || loading || personas.length === 0}
className="h-10 rounded-[6px] bg-brand-500 px-8 shadow-md shadow-brand-500/20 hover:bg-brand-600 disabled:opacity-50" className="h-10 w-full rounded-[6px] bg-brand-500 px-8 shadow-md shadow-brand-500/20 hover:bg-brand-600 disabled:opacity-50 sm:w-auto"
> >
Next: Questions <ArrowRight className="ml-2 h-4 w-4" /> Next: Questions <ArrowRight className="ml-2 h-4 w-4" />
</Button> </Button>

View File

@ -75,17 +75,17 @@ export function ProgramAttachReviewStep({
</div> </div>
{/* Footer Actions */} {/* Footer Actions */}
<div className="flex bg-[#F8FAFC] border border-grayScale-200 items-center rounded-[12px] justify-between py-4 px-6"> <div className="flex flex-col-reverse gap-3 rounded-[12px] border border-grayScale-200 bg-[#F8FAFC] px-4 py-4 sm:flex-row sm:items-center sm:justify-between sm:px-6">
<Button <Button
onClick={onCancel} onClick={onCancel}
variant="outline" variant="outline"
className="h-10 px-6 rounded-[6px] border-grayScale-100 font-bold text-grayScale-500 bg-white hover:bg-grayScale-50 transition-all text-lg" className="h-10 w-full rounded-[6px] border-grayScale-100 bg-white px-6 text-lg font-bold text-grayScale-500 transition-all hover:bg-grayScale-50 sm:w-auto"
> >
Cancel Cancel
</Button> </Button>
<Button <Button
onClick={onPublish} onClick={onPublish}
className="h-10 px-10 rounded-[6px] bg-[#9E2891] text-[16px] font-medium text-white transition-all active:scale-95 flex items-center gap-3" className="flex h-10 w-full items-center justify-center gap-3 rounded-[6px] bg-[#9E2891] px-10 text-[16px] font-medium text-white transition-all active:scale-95 sm:w-auto"
> >
Next: Review & Publish Next: Review & Publish
<ArrowRight className="h-4 w-4" /> <ArrowRight className="h-4 w-4" />

View File

@ -121,7 +121,7 @@ export function ProgramAttachStep1({
</button> </button>
</div> </div>
<div className="flex items-center justify-between border-t border-grayScale-200 bg-[#F8FAFC] py-4 px-12"> <div className="flex flex-col-reverse gap-3 border-t border-grayScale-200 bg-[#F8FAFC] px-4 py-4 sm:flex-row sm:items-center sm:justify-between sm:px-8">
<button <button
className="text-[14px] text-grayScale-500 transition-colors hover:text-grayScale-700" className="text-[14px] text-grayScale-500 transition-colors hover:text-grayScale-700"
onClick={onCancel} onClick={onCancel}
@ -130,7 +130,7 @@ export function ProgramAttachStep1({
</button> </button>
<Button <Button
onClick={nextStep} onClick={nextStep}
className="h-10 px-12 rounded-[6px] bg-[#9E2891] text-[14px] font-bold text-white shadow-lg shadow-brand-500/10 transition-all active:scale-95 flex items-center gap-3" className="flex h-10 w-full items-center justify-center gap-3 rounded-[6px] bg-[#9E2891] px-8 text-[14px] font-bold text-white shadow-lg shadow-brand-500/10 transition-all active:scale-95 sm:w-auto sm:px-12"
> >
Next: Review Next: Review
<ArrowRight className="h-4 w-4" /> <ArrowRight className="h-4 w-4" />

View File

@ -77,8 +77,6 @@ function questionSummaryPreview(
text?: string; text?: string;
dynamicFieldValues?: Record<string, string>; dynamicFieldValues?: Record<string, string>;
questionTypeDefinitionId?: number | null; questionTypeDefinitionId?: number | null;
difficultyLevel?: string;
points?: number;
}, },
def: QuestionTypeDefinition | undefined, def: QuestionTypeDefinition | undefined,
): string { ): string {
@ -186,8 +184,6 @@ function createEmptyQuestionRow(id: string, displayOrder = 1, inheritAnchor?: {
stimulusBlockKey: null as string | null, stimulusBlockKey: null as string | null,
questionTypeDefinitionId: null as number | null, questionTypeDefinitionId: null as number | null,
text: "", text: "",
difficultyLevel: "EASY" as "EASY" | "MEDIUM" | "HARD",
points: 1,
dynamicFieldValues: {} as Record<string, string>, dynamicFieldValues: {} as Record<string, string>,
mcqOptions: defaultMcqOptions(), mcqOptions: defaultMcqOptions(),
trueFalseCorrect: true, trueFalseCorrect: true,
@ -781,9 +777,6 @@ export function QuestionsStep({
Bank #{q.serverQuestionId} Bank #{q.serverQuestionId}
</span> </span>
) : null} ) : null}
<span className="rounded-full bg-grayScale-100 px-2.5 py-0.5 text-[11px] font-semibold uppercase tracking-wide text-grayScale-600">
{q.difficultyLevel ?? "EASY"}
</span>
<span className="rounded-full bg-sky-100 px-2.5 py-0.5 text-[11px] font-semibold text-sky-800"> <span className="rounded-full bg-sky-100 px-2.5 py-0.5 text-[11px] font-semibold text-sky-800">
{sectionBadgeLabel(q, formData.questions)} {sectionBadgeLabel(q, formData.questions)}
</span> </span>
@ -792,9 +785,6 @@ export function QuestionsStep({
{q.stimulusBlockKey} {q.stimulusBlockKey}
</span> </span>
) : null} ) : null}
<span className="text-xs font-medium text-grayScale-500">
{q.points ?? 1} pt{(q.points ?? 1) === 1 ? "" : "s"}
</span>
</div> </div>
<p className="text-xs font-medium text-brand-600"> <p className="text-xs font-medium text-brand-600">
{typeLabel} {typeLabel}
@ -896,55 +886,6 @@ export function QuestionsStep({
</div> </div>
) : null} ) : null}
<div className="grid gap-4 sm:grid-cols-2">
<div className="space-y-2">
<label className="text-[10px] font-bold uppercase tracking-widest text-grayScale-700">
Difficulty
</label>
<select
className="h-11 w-full rounded-lg border border-grayScale-200 bg-white px-3 text-sm font-medium text-grayScale-800"
value={q.difficultyLevel ?? "EASY"}
onChange={(e) => {
const newQuestions = [...formData.questions];
newQuestions[i] = {
...newQuestions[i],
difficultyLevel: e.target.value as
| "EASY"
| "MEDIUM"
| "HARD",
};
setFormData({ ...formData, questions: newQuestions });
}}
>
<option value="EASY">Easy</option>
<option value="MEDIUM">Medium</option>
<option value="HARD">Hard</option>
</select>
</div>
<div className="space-y-2">
<label className="text-[10px] font-bold uppercase tracking-widest text-grayScale-700">
Points
</label>
<Input
type="number"
min={1}
step={1}
value={q.points ?? 1}
onChange={(e) => {
const newQuestions = [...formData.questions];
const parsed = Number.parseInt(e.target.value, 10);
newQuestions[i] = {
...newQuestions[i],
points:
Number.isFinite(parsed) && parsed > 0 ? parsed : 1,
};
setFormData({ ...formData, questions: newQuestions });
}}
className="h-11 rounded-lg border-grayScale-200"
/>
</div>
</div>
<div className="space-y-2"> <div className="space-y-2">
<label className="text-[10px] font-bold uppercase tracking-widest text-grayScale-700"> <label className="text-[10px] font-bold uppercase tracking-widest text-grayScale-700">
Question type Question type
@ -1090,12 +1031,12 @@ export function QuestionsStep({
typeDefinitions={typeDefinitions} typeDefinitions={typeDefinitions}
/> />
<div className="flex items-center justify-between pt-8"> <div className="flex flex-col-reverse gap-3 pt-8 sm:flex-row sm:items-center sm:justify-between">
<Button <Button
type="button" type="button"
onClick={prevStep} onClick={prevStep}
variant="outline" variant="outline"
className="h-10 w-20 rounded-[6px] border-grayScale-200 font-bold text-grayScale-600 shadow-sm" className="h-10 w-full rounded-[6px] border-grayScale-200 font-bold text-grayScale-600 shadow-sm sm:w-20"
> >
Back Back
</Button> </Button>
@ -1157,7 +1098,7 @@ export function QuestionsStep({
nextStep(); nextStep();
}} }}
disabled={definitionsLoading || !!definitionsError || typeDefinitions.length === 0} disabled={definitionsLoading || !!definitionsError || typeDefinitions.length === 0}
className="h-10 rounded-[6px] bg-brand-500 px-8 font-bold disabled:opacity-50" className="h-10 w-full rounded-[6px] bg-brand-500 px-8 font-bold disabled:opacity-50 sm:w-auto"
> >
Next: Review <ArrowRight className="ml-2 h-4 w-4" /> Next: Review <ArrowRight className="ml-2 h-4 w-4" />
</Button> </Button>

View File

@ -334,10 +334,10 @@ export function SelectPracticeToAttachStep({
const footer = ( const footer = (
<div <div
className={cn( className={cn(
"flex items-center justify-between border-t border-grayScale-100", "flex flex-col-reverse gap-3 border-t border-grayScale-100 sm:flex-row sm:items-center sm:justify-between",
isDialog isDialog
? "bg-grayScale-50/60 px-5 py-3.5" ? "bg-grayScale-50/60 px-4 py-3.5 sm:px-5"
: "bg-[#F8FAFC] p-4 px-12", : "bg-[#F8FAFC] px-4 py-4 sm:px-8",
)} )}
> >
<button <button
@ -355,10 +355,10 @@ export function SelectPracticeToAttachStep({
disabled={!canContinue} disabled={!canContinue}
onClick={nextStep} onClick={nextStep}
className={cn( className={cn(
"bg-brand-500 font-bold text-white hover:bg-brand-600 disabled:opacity-50", "w-full bg-brand-500 font-bold text-white hover:bg-brand-600 disabled:opacity-50 sm:w-auto",
isDialog isDialog
? "h-10 rounded-[6px] px-8 text-sm" ? "h-10 rounded-[6px] px-8 text-sm"
: "flex h-10 items-center gap-2 rounded-[6px] px-10 text-[14px] transition-all active:scale-95", : "flex h-10 items-center justify-center gap-2 rounded-[6px] px-10 text-[14px] transition-all active:scale-95",
)} )}
> >
Next: Review Next: Review

View File

@ -17,17 +17,17 @@ export function QuestionTypeStepFooter({
nextDisabled = false, nextDisabled = false,
}: QuestionTypeStepFooterProps) { }: QuestionTypeStepFooterProps) {
return ( return (
<div className="px-4 py-4 border border-grayScale-200 flex flex-wrap items-center justify-between gap-3 bg-[#F8FAFC] dark:bg-grayScale-100"> <div className="flex flex-col-reverse gap-3 border border-grayScale-200 bg-[#F8FAFC] px-4 py-4 dark:bg-grayScale-100 sm:flex-row sm:flex-wrap sm:items-center sm:justify-between">
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
{onBack ? ( {onBack ? (
<Button <Button
type="button" type="button"
variant="outline" variant="outline"
className="h-10 px-6 rounded-[6px] border-none shadow-none text-grayScale-600 font-bold hover:bg-grayScale-100" className="h-10 w-full rounded-[6px] border-none px-6 font-bold text-grayScale-600 shadow-none hover:bg-grayScale-100 sm:w-auto"
onClick={onBack} onClick={onBack}
disabled={saving} disabled={saving}
> >
<ArrowLeft className="h-4 w-4 mr-2 inline" /> <ArrowLeft className="mr-2 inline h-4 w-4" />
Back Back
</Button> </Button>
) : null} ) : null}
@ -36,7 +36,7 @@ export function QuestionTypeStepFooter({
type="button" type="button"
onClick={onNext} onClick={onNext}
disabled={saving || nextDisabled} disabled={saving || nextDisabled}
className="h-10 px-10 rounded-[6px] bg-[#9E2891] font-medium text-white shadow-lg shadow-brand-500/10 hover:bg-[#8A237E] disabled:opacity-50 transition-all flex items-center gap-3" className="flex h-10 w-full items-center justify-center gap-3 rounded-[6px] bg-[#9E2891] px-8 font-medium text-white shadow-lg shadow-brand-500/10 transition-all hover:bg-[#8A237E] disabled:opacity-50 sm:w-auto sm:px-10"
> >
{nextLabel} {nextLabel}
<ArrowRight className="h-5 w-5" /> <ArrowRight className="h-5 w-5" />

View File

@ -346,7 +346,7 @@ export function RolesListPage({ embedded = false }: RolesListPageProps) {
{embedded {embedded
? canEditRoles ? canEditRoles
? "View and edit system roles and permissions." ? "View and edit system roles and permissions."
: "View system roles and permissions. Only Super Admins can make changes." : "View system roles and permissions. Only Admins can make changes."
: "Manage roles and their permissions."} : "Manage roles and their permissions."}
</p> </p>
</div> </div>

View File

@ -358,7 +358,7 @@ export function AppVersionsTab() {
) : null} ) : null}
</div> </div>
) : ( ) : (
<div className="min-w-0 w-full max-w-full overflow-x-auto rounded-[8px] border border-grayScale-100"> <div className="min-w-0 w-full max-w-full overflow-x-auto overscroll-x-contain rounded-[8px] border border-grayScale-100 [-webkit-overflow-scrolling:touch]">
<table className="w-full min-w-[640px] text-left text-sm"> <table className="w-full min-w-[640px] text-left text-sm">
<thead> <thead>
<tr className="border-b border-grayScale-100 bg-grayScale-50/80 text-[11px] font-bold uppercase tracking-wider text-grayScale-400"> <tr className="border-b border-grayScale-100 bg-grayScale-50/80 text-[11px] font-bold uppercase tracking-wider text-grayScale-400">

View File

@ -278,7 +278,7 @@ export function SubscriptionPlansTab() {
) : null} ) : null}
</div> </div>
) : ( ) : (
<div className="min-w-0 w-full max-w-full overflow-x-auto rounded-[8px] border border-grayScale-100"> <div className="min-w-0 w-full max-w-full overflow-x-auto overscroll-x-contain rounded-[8px] border border-grayScale-100 [-webkit-overflow-scrolling:touch]">
<table className="w-full min-w-[800px] text-left text-sm"> <table className="w-full min-w-[800px] text-left text-sm">
<thead> <thead>
<tr className="border-b border-grayScale-100 bg-grayScale-50/80 text-[11px] font-bold uppercase tracking-wider text-grayScale-400"> <tr className="border-b border-grayScale-100 bg-grayScale-50/80 text-[11px] font-bold uppercase tracking-wider text-grayScale-400">

View File

@ -214,7 +214,7 @@ export function TeamManagementPage() {
} catch (error) { } catch (error) {
console.error("Failed to update member status:", error); console.error("Failed to update member status:", error);
setToggledStatuses((prev) => ({ ...prev, [id]: previousActive })); setToggledStatuses((prev) => ({ ...prev, [id]: previousActive }));
notifyApiError(err, "Failed to update team member status. Please try again."); notifyApiError(error, "Failed to update team member status. Please try again.");
} finally { } finally {
setUpdating(false); setUpdating(false);
handleCancelConfirm(); handleCancelConfirm();