mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-09-03 06:12:53 +02:00
Moving next should be mark it as done
This commit is contained in:
@@ -334,19 +334,44 @@ export function AICourseLesson(props: AICourseLessonProps) {
|
|||||||
Previous <span className="hidden lg:inline"> Lesson</span>
|
Previous <span className="hidden lg:inline"> Lesson</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
<div>
|
||||||
onClick={onGoToNextLesson}
|
<button
|
||||||
disabled={cantGoForward}
|
onClick={() => {
|
||||||
className={cn(
|
if (!isLessonDone) {
|
||||||
'flex items-center rounded-full px-4 py-2 disabled:opacity-50 max-lg:px-3 max-lg:py-1.5 max-lg:text-sm',
|
toggleDone(undefined, {
|
||||||
cantGoForward
|
onSuccess: () => {
|
||||||
? 'cursor-not-allowed text-gray-400'
|
onGoToNextLesson();
|
||||||
: 'bg-gray-800 text-white hover:bg-gray-700',
|
},
|
||||||
)}
|
});
|
||||||
>
|
} else {
|
||||||
Next <span className="hidden lg:inline"> Lesson</span>
|
onGoToNextLesson();
|
||||||
<ChevronRight size={16} className="ml-2" />
|
}
|
||||||
</button>
|
}}
|
||||||
|
disabled={cantGoForward || isTogglingDone}
|
||||||
|
className={cn(
|
||||||
|
'flex items-center rounded-full px-4 py-2 disabled:opacity-50 max-lg:px-3 max-lg:py-1.5 max-lg:text-sm',
|
||||||
|
cantGoForward
|
||||||
|
? 'cursor-not-allowed text-gray-400'
|
||||||
|
: 'bg-gray-800 text-white hover:bg-gray-700',
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
{isTogglingDone ? (
|
||||||
|
<>
|
||||||
|
<Loader2Icon
|
||||||
|
size={16}
|
||||||
|
strokeWidth={3}
|
||||||
|
className="animate-spin text-white"
|
||||||
|
/>
|
||||||
|
Please wait ...
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
Next <span className="hidden lg:inline"> Lesson</span>
|
||||||
|
<ChevronRight size={16} className="ml-2" />
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user