Skip to content

Commit

Permalink
Revert "feat: get certification"
Browse files Browse the repository at this point in the history
This reverts commit 2a0933a.
  • Loading branch information
JeelRajodiya committed Oct 6, 2024
1 parent 2a0933a commit c80f6da
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 165 deletions.
12 changes: 0 additions & 12 deletions app/components/CertificateButton/CertificateButton.module.css

This file was deleted.

112 changes: 0 additions & 112 deletions app/components/CertificateButton/CertificateButton.tsx

This file was deleted.

1 change: 0 additions & 1 deletion app/components/CertificateButton/index.tsx

This file was deleted.

5 changes: 3 additions & 2 deletions app/components/Feedback/Feedback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import Dislike from "@/app/styles/icons/BiDislike";
import { Flex } from "@chakra-ui/react";
import { usePathname } from "next/navigation";
import styles from "./Feedback.module.css";
import { googleSheetAPIRoute } from "@/lib/contentVariables";

export default function Feedback() {
const APIRoute =
"https://script.google.com/macros/s/AKfycbz0f87eDgEghSelILb3RSdHe-Rr7HKAdMxx8tvTq4fNAfJt0fZ7t-G-p1BrVEQM2Mws/exec";
const [isSubmitted, setIsSubmitted] = useState(false);
const pathname = usePathname();
const submitFeedback = async (feedback: string) => {
await fetch(googleSheetAPIRoute, {
await fetch(APIRoute, {
method: "POST",
body: JSON.stringify({
feedback: feedback,
Expand Down
9 changes: 1 addition & 8 deletions app/components/OutlineDrawer/OutlineDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@ import {
DrawerHeader,
DrawerCloseButton,
DrawerBody,
Button,
} from "@chakra-ui/react";
import styles from "./OutlineDrawer.module.css";
import { ContentOutline } from "@/lib/types";
import ChapterItem from "../ChapterItem";
import { isChapterCompleted } from "@/lib/client-functions";
import Link from "next/link";
import CertificateButton from "../CertificateButton/CertificateButton";

export default function OutlineDrawer({
isOpen,
Expand Down Expand Up @@ -42,11 +39,7 @@ export default function OutlineDrawer({
<DrawerOverlay />
<DrawerContent>
<DrawerCloseButton />
<DrawerHeader display={"flex"} justifyContent={"space-between"}>

Outline
<CertificateButton />
</DrawerHeader>
<DrawerHeader>Outline</DrawerHeader>

<DrawerBody>
<nav>
Expand Down
12 changes: 1 addition & 11 deletions app/styles/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,16 +136,6 @@ const Popover = {
},
};

const Modal = {
baseStyle: {
dialog: {
bg: "hsl(var(--background))",
color: "hsl(var(--text))",
borderRadius: "16px"
}
}
}

export const theme = extendTheme({
config: {
initialColorMode: "light",
Expand All @@ -159,6 +149,6 @@ export const theme = extendTheme({
},
},
},
components: { Button, Menu, Switch, Drawer, Tooltip, Popover, Modal },
components: { Button, Menu, Switch, Drawer, Tooltip, Popover },
fonts: {},
});
8 changes: 0 additions & 8 deletions lib/client-functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { OutputReducerAction } from "./reducers";
import { CodeFile, TestCaseResult } from "./types";
import { hyperjumpCheckAnnotations, hyperjumpValidate } from "./validators";
import { sendGAEvent } from "@next/third-parties/google";
import { contentManager } from "./contentManager";

export async function validateCode(
codeString: string,
Expand Down Expand Up @@ -137,13 +136,6 @@ export function isChapterCompleted(chapterIndex: number, totalSteps: number) {
return true;
}


export function isTheTourCompleted() {
const totalStepsForAllChapters = contentManager.getNumberOfStepsFromAllChapters();
const completedSteps = Object.keys(JSON.parse(localStorage.getItem("progress")!)).length;
return totalStepsForAllChapters === completedSteps;
}

export function hasNestedProperty(obj: any, path: string) {
console.log(obj, path);
const keys = path.split(".");
Expand Down
10 changes: 0 additions & 10 deletions lib/contentManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,6 @@ export default class ContentManager {
public getTotalSteps(chapterIndex: number) {
return this.getOutline()[chapterIndex].steps.length;
}

public getNumberOfStepsFromAllChapters() {
let totalSteps = 0;
let totalChapters = this.getTotalChapters();
for (let i = 0; i < totalChapters; i++) {
totalSteps += this.getTotalSteps(i);
}
return totalSteps;
}

public getInstructionsFilePath(urlPath: string) {
return `${contentFolderName}/${urlPath}/${instructionsFileName}`;
}
Expand Down
1 change: 0 additions & 1 deletion lib/contentVariables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ export const contentFolderPath: string = "./content";
export const contentFolderName: string = contentFolderPath.replace("./", "");
export const indexFileName = "index.mdx";
export const instructionsFileName = "instructions.mdx";
export const googleSheetAPIRoute = "https://script.google.com/macros/s/AKfycbxjH778iyBlZ8_oY946fTLW6H0HcfByaNk0collEgIwERwnpeErkaYEuKjWxAQ2qg/exec"

0 comments on commit c80f6da

Please sign in to comment.