Skip to content

Commit

Permalink
Fixs and add new features 😂
Browse files Browse the repository at this point in the history
  • Loading branch information
m7medVision committed Jan 13, 2024
1 parent 1dc92c0 commit 680f56b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions components/EditorSplit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default function EditorSplit(props: { slug: string }) {
<Editor
preCode={'console.log("Hello World!")'}
testcases={testcases}
slug={props.slug}
/>
</>
);
Expand Down
13 changes: 11 additions & 2 deletions islands/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { doTests } from "./DoTest.ts";
interface CounterProps {
preCode: string;
testcases: any[];
slug: string;
}

declare var window: Window & typeof globalThis;
Expand Down Expand Up @@ -34,13 +35,21 @@ export default function Editor(props: CounterProps) {
const code: string = window.editor.getValue() || "";
const runOutput = handleCodeRun();
const testcases = props.testcases;
// TODO: work on this later
// if (testcases.length === 0) {
// showToast({
// msg: "لا يوجد اختبارات لهذا الدرس",
// type: "info",
// });
// return;
// }
// // TODO: work on this later
// const pass = doTests(testcases, code, runOutput);
// if (pass) {
// showToast({
// msg: "تم تجاوز الاختبارات بنجاح",
// type: "success",
// });
// localStorage.setItem(props.slug, "done");
// return;
// } else {
// showToast({
Expand All @@ -50,7 +59,7 @@ export default function Editor(props: CounterProps) {
// return;
// }
showToast({
msg: "هذه الخاصية غير متوفرة حالياً",
msg: "هذه الميزة غير متوفرة حالياً",
type: "warning",
});
}
Expand Down
2 changes: 1 addition & 1 deletion islands/ThemeToggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function ThemeToggle() {
};

return (
<label class="swap swap-rotate btn btn-active btn-ghost opacity-50">
<label class="swap swap-rotate btn btn-active btn-ghost">
<input
type="checkbox"
onChange={handleThemeChange}
Expand Down
2 changes: 1 addition & 1 deletion routes/[...slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default function CoursePage(
</div>
</div>
</main>
<ProgressTrack slug={course.slug} />
{/* <ProgressTrack slug={course.slug} /> */}
</>
);
}

0 comments on commit 680f56b

Please sign in to comment.