Add JavaScript and VCS content and fix rendering issue

This commit is contained in:
Kamran Ahmed
2021-12-10 00:52:40 +01:00
parent 56816d15f8
commit 6e451ef5cf
7 changed files with 50 additions and 85 deletions

View File

@ -3,6 +3,7 @@ import { RemoveScroll } from 'react-remove-scroll';
import { RoadmapType } from '../../lib/roadmap';
import RoadmapGroup from '../../pages/[roadmap]/[group]';
import { CheckIcon, CloseIcon, RepeatIcon } from '@chakra-ui/icons';
import { queryGroupElementsById } from '../../lib/renderer/utils';
type ContentDrawerProps = {
roadmap: RoadmapType;
@ -52,9 +53,9 @@ export function ContentDrawer(props: ContentDrawerProps) {
<Button
onClick={() => {
localStorage.setItem(groupId, 'done');
document
.querySelectorAll(`[data-group-id$="-${groupId}"]`)
.forEach((item) => item?.classList?.add('done'));
queryGroupElementsById(groupId).forEach((item) =>
item?.classList?.add('done')
);
onClose();
}}
colorScheme="green"
@ -75,9 +76,9 @@ export function ContentDrawer(props: ContentDrawerProps) {
<Button
onClick={() => {
localStorage.removeItem(groupId);
document
.querySelectorAll(`[data-group-id$="-${groupId}"]`)
.forEach((item) => item?.classList?.remove('done'));
queryGroupElementsById(groupId).forEach((item) =>
item?.classList?.remove('done')
);
onClose();
}}
colorScheme="red"