Skip to content

Commit

Permalink
Small UI changes
Browse files Browse the repository at this point in the history
  • Loading branch information
martineckardt committed Sep 10, 2024
1 parent a041303 commit d1f82af
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions components/certificates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ interface CertificatePageProps {
interface QuizInfo {
id: string;
chapter: string;
question: string;
}

interface QuizData {
Expand Down Expand Up @@ -54,7 +55,8 @@ const CertificatePage: React.FC<CertificatePageProps> = ({ courseId }) => {
const courseQuizzes = quizData.courses[courseId]?.quizzes || [];
const quizzesWithChapters = courseQuizzes.map(quizId => ({
id: quizId,
chapter: quizData.quizzes[quizId]?.chapter || 'Unknown Chapter'
chapter: quizData.quizzes[quizId]?.chapter || 'Unknown Chapter',
question: quizData.quizzes[quizId]?.question || ''
}));
setQuizzes(quizzesWithChapters);
};
Expand Down Expand Up @@ -156,7 +158,7 @@ const CertificatePage: React.FC<CertificatePageProps> = ({ courseId }) => {
<h3 className="text-xl font-medium mb-4">{chapter}</h3>
<Accordions type="single" collapsible>
{incompleteQuizzes.map((quiz) => (
<Accordion key={quiz.id} title={`Quiz ${quiz.id}`}>
<Accordion key={quiz.id} title={`${quiz.question}`}>
<Quiz quizId={quiz.id} />
</Accordion>
))}
Expand Down Expand Up @@ -227,7 +229,7 @@ const CertificatePage: React.FC<CertificatePageProps> = ({ courseId }) => {
</div>
)}
{!allQuizzesCompleted && (
<div className="mt-8 text-center text-gray-600 dark:text-gray-400 bg-yellow-50 dark:bg-yellow-900/30 p-4 rounded-lg">
<div className="mt-12 bg-muted rounded-lg shadow-lg p-8">
<Share2 className="w-8 h-8 mx-auto mb-2 text-yellow-500" />
Complete all quizzes to unlock your certificate and share your achievement!
</div>
Expand Down

0 comments on commit d1f82af

Please sign in to comment.