diff --git a/components/roadmap/content-drawer.tsx b/components/roadmap/content-drawer.tsx index 77ddeb74d..4a045e738 100644 --- a/components/roadmap/content-drawer.tsx +++ b/components/roadmap/content-drawer.tsx @@ -19,13 +19,25 @@ export function markTopicDone(groupId: string) { ); } +export function markTopicPending(groupId: string) { + localStorage.removeItem(groupId); + + queryGroupElementsById(groupId).forEach((item) => + item?.classList?.remove('done') + ); +} + +export function isTopicDone(groupId: string) { + return localStorage.getItem(groupId) === 'done'; +} + export function ContentDrawer(props: ContentDrawerProps) { const { roadmap, groupId, onClose = () => null } = props; if (!groupId) { return null; } - const isDone = localStorage.getItem(groupId) === 'done'; + const isDone = isTopicDone(groupId); return ( @@ -80,10 +92,7 @@ export function ContentDrawer(props: ContentDrawerProps) { {isDone && (