fix: bigger text and confirmation for unmarking an activity

This commit is contained in:
swve 2025-04-18 17:36:19 +02:00
parent c605c2a8f4
commit 39ab1a132e
2 changed files with 31 additions and 23 deletions

View file

@ -340,9 +340,13 @@ export function MarkStatus(props: {
content="Unmark as complete" content="Unmark as complete"
side="top" side="top"
> >
<ConfirmationModal
confirmationButtonText="Unmark Activity"
confirmationMessage="Are you sure you want to unmark this activity as complete? This will affect your course progress."
dialogTitle="Unmark activity as complete"
dialogTrigger={
<div <div
className={`${isLoading ? 'opacity-75 cursor-not-allowed' : ''} bg-red-400 rounded-full p-2 drop-shadow-md flex items-center text-white hover:cursor-pointer transition delay-150 duration-300 ease-in-out`} className={`${isLoading ? 'opacity-75 cursor-not-allowed' : ''} bg-red-400 rounded-full p-2 drop-shadow-md flex items-center text-white hover:cursor-pointer transition delay-150 duration-300 ease-in-out`}
onClick={!isLoading ? unmarkActivityAsCompleteFront : undefined}
> >
{isLoading ? ( {isLoading ? (
<div className="animate-spin"> <div className="animate-spin">
@ -355,6 +359,10 @@ export function MarkStatus(props: {
<X size={17} /> <X size={17} />
)} )}
</div> </div>
}
functionToExecute={unmarkActivityAsCompleteFront}
status="warning"
/>
</ToolTip> </ToolTip>
</div> </div>
) : ( ) : (

View file

@ -125,8 +125,8 @@ export default function FixedActivitySecondaryBar(props: FixedActivitySecondaryB
orgslug={props.orgslug} orgslug={props.orgslug}
/> />
<div className="flex flex-col -space-y-0.5 min-w-0 hidden sm:block"> <div className="flex flex-col -space-y-0.5 min-w-0 hidden sm:block">
<p className="text-xs font-medium text-gray-500">Course</p> <p className="text-sm font-medium text-gray-500">Course</p>
<h1 className="font-semibold text-gray-900 text-sm truncate"> <h1 className="font-semibold text-gray-900 text-base truncate">
{props.course.name} {props.course.name}
</h1> </h1>
</div> </div>
@ -145,16 +145,16 @@ export default function FixedActivitySecondaryBar(props: FixedActivitySecondaryB
disabled={!prevActivity} disabled={!prevActivity}
title={prevActivity ? `Previous: ${prevActivity.name}` : 'No previous activity'} title={prevActivity ? `Previous: ${prevActivity.name}` : 'No previous activity'}
> >
<ChevronLeft size={14} className="shrink-0 sm:w-4 sm:h-4" /> <ChevronLeft size={16} className="shrink-0 sm:w-5 sm:h-5" />
<div className="flex flex-col items-start hidden sm:flex"> <div className="flex flex-col items-start hidden sm:flex">
<span className="text-[10px] text-gray-500">Previous</span> <span className="text-xs text-gray-500">Previous</span>
<span className="text-xs font-medium text-left truncate max-w-[100px] sm:max-w-[150px]"> <span className="text-sm font-medium text-left truncate max-w-[100px] sm:max-w-[150px]">
{prevActivity ? prevActivity.name : 'No previous activity'} {prevActivity ? prevActivity.name : 'No previous activity'}
</span> </span>
</div> </div>
</button> </button>
<span className="text-xs font-medium text-gray-500 px-1 sm:px-2"> <span className="text-sm font-medium text-gray-500 px-1 sm:px-2">
{currentIndex + 1} of {allActivities.length} {currentIndex + 1} of {allActivities.length}
</span> </span>
@ -169,12 +169,12 @@ export default function FixedActivitySecondaryBar(props: FixedActivitySecondaryB
title={nextActivity ? `Next: ${nextActivity.name}` : 'No next activity'} title={nextActivity ? `Next: ${nextActivity.name}` : 'No next activity'}
> >
<div className="flex flex-col items-end hidden sm:flex"> <div className="flex flex-col items-end hidden sm:flex">
<span className={`text-[10px] ${nextActivity ? 'text-gray-500' : 'text-gray-500'}`}>Next</span> <span className={`text-xs ${nextActivity ? 'text-gray-500' : 'text-gray-500'}`}>Next</span>
<span className="text-xs font-medium text-right truncate max-w-[100px] sm:max-w-[150px]"> <span className="text-sm font-medium text-right truncate max-w-[100px] sm:max-w-[150px]">
{nextActivity ? nextActivity.name : 'No next activity'} {nextActivity ? nextActivity.name : 'No next activity'}
</span> </span>
</div> </div>
<ChevronRight size={14} className="shrink-0 sm:w-4 sm:h-4" /> <ChevronRight size={16} className="shrink-0 sm:w-5 sm:h-5" />
</button> </button>
</div> </div>
</div> </div>