-
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
6 changed files
with
45 additions
and
4 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
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
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { useState } from "preact/hooks"; | ||
|
||
import IconCircle from "https://deno.land/x/tabler_icons_tsx@0.0.5/tsx/circle.tsx"; | ||
import IconCircleCheckFilled from "https://deno.land/x/tabler_icons_tsx@0.0.5/tsx/circle-check-filled.tsx"; | ||
|
||
interface ProgressTrackProps { | ||
slug: string; | ||
} | ||
|
||
export default function ProgressCheck(props: ProgressTrackProps) { | ||
const [isDone, setIsDone] = useState( | ||
localStorage.getItem(props.slug.replace(/\\/g, "/")) === "done", | ||
); | ||
return isDone | ||
? <IconCircleCheckFilled aria-hidden="true" class="h-4 w-4" /> | ||
: <IconCircle aria-hidden="true" class="h-4 w-4" />; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { useEffect } from "preact/hooks"; | ||
|
||
interface ProgressTrackProps { | ||
slug: string; | ||
} | ||
|
||
export default function ProgressTrack(props: ProgressTrackProps) { | ||
useEffect(() => { | ||
const initializeEditor = () => { | ||
localStorage.setItem(props.slug, "done"); | ||
}; | ||
window.onload = initializeEditor; | ||
return () => { | ||
window.onload = null; | ||
}; | ||
}, []); | ||
|
||
return <></>; | ||
} |
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
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