Replies: 1 comment 3 replies
-
Hey @GaetanRdn! I think this relates to #178 as right now we don't have any way of knowing that the exercise was completed successfully. Once we have access to this information I think we will expose that through the import { tutorialStore } from 'tutorialkit:store';
import { useStore } from '@nanostore/react';
export default function Congratz() {
const completed = useStore(tutorialStore.lessonSolved);
if (!completed) {
return null;
}
return (
<div className="fixed inset-0 flex items-center justify-center z-50">
<div className="absolute inset-0 bg-black opacity-50"></div>
<div className="bg-white p-8 rounded-lg shadow-lg z-10 max-w-md w-full">
<h2 className="text-2xl font-bold mb-4">Congratulations!</h2>
<p className="text-gray-700 mb-6">You've successfully completed the lesson. Great job!</p>
</div>
</div>
);
} And then in a lesson: ---
type: lesson
title: Foo
---
import Congratz from '@components/Congratz';
<Congratz />
# Welcome to Foo!
... |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
It could be great to detect if the user has succeed the exercice and congrats him.
Beta Was this translation helpful? Give feedback.
All reactions