Skip to content

Commit

Permalink
fix: course landing page bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
rotimi-best committed Nov 9, 2023
1 parent d2fb5db commit b8090f3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
let discount = 0;
let paymentLink = '';
let showDiscount = false;
let giftToggled = false;
let showDiscount: boolean | undefined = undefined;
let giftToggled: boolean | undefined = undefined;
let hasBeenSet = false;
Expand All @@ -30,7 +30,7 @@
giftToggled = get(course, 'metadata.reward.show', false);
}
function setter(value: string | number | boolean, setterKey: string) {
function setter(value: string | number | boolean | undefined, setterKey: string) {
if (typeof value !== 'boolean' && !value) return;
const _course = cloneDeep(course);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
attendance: undefined,
group: undefined,
lessons: undefined,
polls: undefined,
slug: course.slug
});
loading = false;
Expand Down
5 changes: 3 additions & 2 deletions src/lib/components/CourseLandingPage/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import { VARIANTS } from '$lib/components/PrimaryButton/constants';
import HtmlRender from '$lib/components/HTMLRender/HTMLRender.svelte';
import { calDateDiff } from '$lib/utils/functions/date';
import { currentOrg } from '$lib/utils/store/org';
export let editMode = false;
export let courseData: Course;
Expand Down Expand Up @@ -95,7 +96,7 @@
</script>

<svelte:head>
<title>{get(courseData, 'title', '')}</title>
<title>{editMode ? '[app] - ' : ''}{get(courseData, 'title', '')}</title>
<meta name="description" content={get(courseData, 'description', '')} />
<meta name="theme-color" content="#ffffff" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
Expand Down Expand Up @@ -421,7 +422,7 @@
<img
alt="Author Avatar"
class="block rounded-full h-20 w-20 mr-3"
src={get(instructor, 'imgUrl', '')}
src={get(instructor, 'imgUrl', $currentOrg.avatar_url)}
/>
<div>
<p class="dark:text-white text-md font-light">
Expand Down

0 comments on commit b8090f3

Please sign in to comment.