fix: course and org landing page improvements (#468)
* make gift section HTML rendered * hide classroomio branding on landing page * improve section expanding * feat: toggle show sections on course landing page * fix: show discount on landing page course card
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { fade } from 'svelte/transition';
|
||||
import get from 'lodash/get';
|
||||
import { onMount } from 'svelte';
|
||||
import LogoFacebook from 'carbon-icons-svelte/lib/LogoFacebook.svelte';
|
||||
import LogoTwitter from 'carbon-icons-svelte/lib/LogoTwitter.svelte';
|
||||
import LogoLinkedin from 'carbon-icons-svelte/lib/LogoLinkedin.svelte';
|
||||
@@ -29,9 +28,10 @@
|
||||
import { landingPageSettings } from '$lib/components/Org/Settings/store';
|
||||
import { t } from '$lib/utils/functions/translations';
|
||||
import PoweredBy from '$lib/components/Upgrade/PoweredBy.svelte';
|
||||
import type { CurrentOrg } from '$lib/utils/types/org';
|
||||
|
||||
export let orgSiteName = '';
|
||||
export let org = {};
|
||||
export let org: CurrentOrg | null;
|
||||
|
||||
let email: string | undefined;
|
||||
let isAdding = false;
|
||||
@@ -46,12 +46,12 @@
|
||||
phone: '',
|
||||
message: ''
|
||||
};
|
||||
let contactError = {};
|
||||
let contactError: Record<string, string> = {};
|
||||
|
||||
const supabase = getSupabase();
|
||||
|
||||
async function handleSubmit() {
|
||||
if (!email || !validateEmail(email)) return;
|
||||
if (!email || !validateEmail(email) || !org) return;
|
||||
isAdding = true;
|
||||
|
||||
const { error } = await supabase.from('organization_emaillist').insert({
|
||||
@@ -85,7 +85,7 @@
|
||||
email: contact.email,
|
||||
phone: contact.phone,
|
||||
message: contact.message,
|
||||
organization_id: org.id
|
||||
organization_id: org?.id
|
||||
});
|
||||
|
||||
if (error) {
|
||||
@@ -148,18 +148,18 @@
|
||||
}
|
||||
|
||||
$: initPlyr(player, $landingPageSettings.header?.banner?.video);
|
||||
$: setDefault(org.landingpage);
|
||||
$: setDefault(org?.landingpage);
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>
|
||||
{!org.name ? '' : `${org.name}'s `}{$t('course.navItem.landing_page.landing_page')}
|
||||
{!org?.name ? '' : `${org.name}'s `}{$t('course.navItem.landing_page.landing_page')}
|
||||
</title>
|
||||
</svelte:head>
|
||||
|
||||
<PoweredBy />
|
||||
|
||||
{#if !org.landingpage}
|
||||
{#if !org?.landingpage}
|
||||
<PageLoader />
|
||||
{:else}
|
||||
<main>
|
||||
@@ -312,7 +312,12 @@
|
||||
type={courseData.type}
|
||||
description={courseData.description}
|
||||
isPublished={courseData.is_published}
|
||||
cost={courseData.cost}
|
||||
pricingData={{
|
||||
cost: courseData.cost,
|
||||
discount: courseData.metadata.discount,
|
||||
showDiscount: courseData.metadata.showDiscount,
|
||||
currency: courseData.currency
|
||||
}}
|
||||
currency={courseData.currency}
|
||||
totalLessons={get(courseData, 'lessons[0].count', 0)}
|
||||
isOnLandingPage={true}
|
||||
@@ -442,8 +447,7 @@
|
||||
label={$t('course.navItem.landing_page.message')}
|
||||
bind:value={contact.message}
|
||||
errorMessage={contactError.message}
|
||||
rows="9"
|
||||
maxRows={15}
|
||||
rows={9}
|
||||
placeholder={$t('course.navItem.landing_page.your_message')}
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user