fix: course page rerendering twice

This commit is contained in:
Rotimi Best
2023-12-13 09:02:52 +03:00
parent 9ee723c65b
commit 4a64d2affe
6 changed files with 108 additions and 36 deletions
+1 -1
View File
@@ -59,7 +59,7 @@
"@babel/plugin-transform-runtime": "^7.22.9",
"@babel/preset-env": "^7.22.9",
"@babel/runtime": "^7.22.6",
"@sveltejs/kit": "^1.22.4",
"@sveltejs/kit": "^1.29.0",
"@tailwindcss/typography": "^0.5.9",
"@types/lodash": "^4.14.196",
"@types/nodemailer": "^6.4.11",
+9
View File
@@ -118,6 +118,15 @@ code {
fill: red;
}
.org-root {
height: calc(100vh - 48px);
}
.org-slot {
min-width: calc(100vw - 250px);
height: calc(100vh - 48px);
overflow-y: auto;
}
@tailwind components;
@tailwind utilities;
+1 -29
View File
@@ -318,26 +318,7 @@
{/if}
<div class="flex justify-between">
{#if isOrgPage($page.url?.pathname)}
<AddOrgModal />
<div class="org-root w-full flex items-center justify-between">
{#if !isQuizPage($page.url?.pathname)}
<OrgSideBar />
{/if}
<div class="org-slot bg-white dark:bg-black w-full">
<slot />
</div>
</div>
{:else if isLMSPage($page.url?.pathname)}
<div class="org-root w-full flex items-center justify-between">
<LMSSideBar />
<div class="org-slot bg-white dark:bg-black w-full">
<slot />
</div>
</div>
{:else}
<slot />
{/if}
<slot />
{#if showAppsSideBar(path)}
<Apps />
@@ -352,15 +333,6 @@
box-sizing: border-box;
}
.org-root {
height: calc(100vh - 48px);
}
.org-slot {
min-width: calc(100vw - 250px);
height: calc(100vh - 48px);
overflow-y: auto;
}
:global(a:hover) {
text-decoration: underline;
}
@@ -0,0 +1,10 @@
<script>
import LMSSideBar from '$lib/components/LMS/SideBar.svelte';
</script>
<div class="org-root w-full flex items-center justify-between">
<LMSSideBar />
<div class="org-slot bg-white dark:bg-black w-full">
<slot />
</div>
</div>
@@ -0,0 +1,17 @@
<script>
import { page } from '$app/stores';
import AddOrgModal from '$lib/components/Org/AddOrgModal/AddOrgModal.svelte';
import { isQuizPage } from '$lib/utils/functions/app';
import OrgSideBar from '$lib/components/Org/SideBar.svelte';
</script>
<AddOrgModal />
<div class="org-root w-full flex items-center justify-between">
{#if !isQuizPage($page.url?.pathname)}
<OrgSideBar />
{/if}
<div class="org-slot bg-white dark:bg-black w-full">
<slot />
</div>
</div>