fix: start learning

feat/course
Arik Chakma 1 week ago
parent a749f36df1
commit 090d43199f
  1. 4
      src/components/CourseLanding/EnrollButton.tsx

@ -66,6 +66,8 @@ export function EnrollButton(props: EnrollButtonProps) {
); );
const hasEnrolled = !!courseProgress?.startedAt; const hasEnrolled = !!courseProgress?.startedAt;
const hasProgress =
courseProgress?.startedAt && courseProgress?.completed?.length > 0;
return ( return (
<button <button
@ -103,7 +105,7 @@ export function EnrollButton(props: EnrollButtonProps) {
disabled={isCreatingCheckoutSession || isLoading} disabled={isCreatingCheckoutSession || isLoading}
> >
{hasEnrolled && !isCreatingCheckoutSession && ( {hasEnrolled && !isCreatingCheckoutSession && (
<span>Resume Learning</span> <span>{hasProgress ? 'Resume Learning' : 'Start Learning'}</span>
)} )}
{!hasEnrolled && !isCreatingCheckoutSession && ( {!hasEnrolled && !isCreatingCheckoutSession && (

Loading…
Cancel
Save