From d9825c98dd232c61c55c7e23944de82f2e2e63c2 Mon Sep 17 00:00:00 2001
From: Mohammed <88824957+m7medVision@users.noreply.github.com>
Date: Tue, 20 Feb 2024 20:03:50 +0400
Subject: [PATCH 1/2] Add partial components for Lessons
---
components/EditorSplit.tsx | 13 +++--
components/MarkdownSplit.tsx | 96 +++++++++++++++++++-----------------
routes/[...slug].tsx | 2 +-
3 files changed, 61 insertions(+), 50 deletions(-)
diff --git a/components/EditorSplit.tsx b/components/EditorSplit.tsx
index a5d7af6..e55142c 100644
--- a/components/EditorSplit.tsx
+++ b/components/EditorSplit.tsx
@@ -1,3 +1,4 @@
+import { Partial } from "$fresh/runtime.ts";
import Editor from "../islands/Editor.tsx";
import { getPreCode } from "../utils/precode.ts";
import { getTestingCode } from "../utils/testingcode.ts";
@@ -30,11 +31,13 @@ export default function EditorSplit(props: EditorSplitProps) {
-
+
+
+
);
}
diff --git a/components/MarkdownSplit.tsx b/components/MarkdownSplit.tsx
index 8dd2c46..36800e3 100644
--- a/components/MarkdownSplit.tsx
+++ b/components/MarkdownSplit.tsx
@@ -5,6 +5,7 @@ import EditButton from "../components/EditButton.tsx";
import IconPlayerTrackNext from "https://deno.land/x/tabler_icons_tsx@0.0.5/tsx/player-track-next.tsx";
import IconPlayerTrackPrev from "https://deno.land/x/tabler_icons_tsx@0.0.5/tsx/player-track-prev.tsx";
+import { Partial } from "$fresh/runtime.ts";
interface MarkdownSplitProps {
course: Course;
@@ -24,63 +25,70 @@ export default function MarkdownSplit({
return (
<>
- {nextCourse && (
-
- )}
+
+ {nextCourse && (
+
+ )}
- {prevCourse && (
-
- )}
+ {prevCourse && (
+
+ )}
+
-
- -
- الدروس
-
- {lable && (
+
+
+ {lable && (
+ -
+ {lable}
+
+ )}
+ - {course.title}
+
+
-
{course.title}
-
+
+ {course.title}
+
+
-
-
+
+
+
>
);
diff --git a/routes/[...slug].tsx b/routes/[...slug].tsx
index 56f749e..b73ba9b 100644
--- a/routes/[...slug].tsx
+++ b/routes/[...slug].tsx
@@ -77,7 +77,7 @@ export default function CoursePage(
-
+
{/* Small screen editor/docs toggle button */}
{/* Course page loading */}
From fb057d6fa50e5a625e55b8be4cfa57f9b90e2130 Mon Sep 17 00:00:00 2001
From: Mohammed <88824957+m7medVision@users.noreply.github.com>
Date: Tue, 20 Feb 2024 20:10:11 +0400
Subject: [PATCH 2/2] Add f-partial attribute
---
components/MarkdownSplit.tsx | 2 ++
routes/index.tsx | 1 +
2 files changed, 3 insertions(+)
diff --git a/components/MarkdownSplit.tsx b/components/MarkdownSplit.tsx
index 36800e3..88df7b4 100644
--- a/components/MarkdownSplit.tsx
+++ b/components/MarkdownSplit.tsx
@@ -29,6 +29,7 @@ export default function MarkdownSplit({
{nextCourse && (