-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
2 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,9 @@ | ||
import { Course } from "../utils/types.ts"; | ||
|
||
import IconCircle from "https://deno.land/x/[email protected]/tsx/circle.tsx"; | ||
import IconcircleCheck from "https://deno.land/x/[email protected]/tsx/circle-check.tsx"; | ||
|
||
// import IconcircleCheck from "https://deno.land/x/[email protected]/tsx/circle-check.tsx"; | ||
|
||
export default function CourseCard(props: { course: Course }) { | ||
|
||
// FOR TESTING PURPOSES ONLY | ||
// add comments course to the local storage | ||
// localStorage.setItem("completedCourses", JSON.stringify(["comments"])); | ||
|
||
// check if the student has completed the course from the local storage | ||
const completedCourses = localStorage.getItem("completedCourses"); | ||
const completedCoursesArray = completedCourses | ||
? JSON.parse(completedCourses) | ||
: []; | ||
const isCompleted = completedCoursesArray.includes(props.course.slug); | ||
const { course } = props; | ||
return ( | ||
<div | ||
|
@@ -24,11 +12,7 @@ export default function CourseCard(props: { course: Course }) { | |
> | ||
<a title={course.title} href={`/${course.slug}`}> | ||
<h3 class="text-gray-500 font-bold flex gap-1 items-center"> | ||
{/* <IconCircle aria-hidden="true" class="h-4 w-4" /> {course.title} */} | ||
{ | ||
|
||
isCompleted ? <IconcircleCheck aria-hidden="true" class="h-4 w-4 text-gray-300" /> : <IconCircle aria-hidden="true" class="h-4 w-4" /> | ||
} | ||
<IconCircle aria-hidden="true" class="h-4 w-4" /> | ||
{course.title} | ||
</h3> | ||
</a> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters