fix: env dynamic not available on prerendering

This commit is contained in:
Rotimi Best
2024-10-20 02:26:03 +01:00
parent c16d036cc3
commit c9271a11ce
3 changed files with 6 additions and 6 deletions
@@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import Section from './CoreFeatureSection.svelte'; import Section from './CoreFeatureSection.svelte';
import { env } from '$env/dynamic/public'; import { PUBLIC_ENABLE_STATS } from '$env/static/public';
</script> </script>
<section class="w-full py-32 border-b border-x-0 border-t-0 border-gray-200"> <section class="w-full py-32 border-b border-x-0 border-t-0 border-gray-200">
@@ -78,7 +78,7 @@
/> />
<!-- body section 5 --> <!-- body section 5 -->
{#if env.PUBLIC_ENABLE_STATS} {#if PUBLIC_ENABLE_STATS}
<div <div
class="flex justify-between flex-row flex-wrap lg:flex-nowrap items-center text-center px-[10%] py-[7%] border-b-[1px] gap-y-20 gap-x-20 mx-0 lg:mx-[12%]" class="flex justify-between flex-row flex-wrap lg:flex-nowrap items-center text-center px-[10%] py-[7%] border-b-[1px] gap-y-20 gap-x-20 mx-0 lg:mx-[12%]"
> >
@@ -2,7 +2,7 @@
import { onMount, onDestroy } from 'svelte'; import { onMount, onDestroy } from 'svelte';
import { fly } from 'svelte/transition'; import { fly } from 'svelte/transition';
import { sineInOut } from 'svelte/easing'; import { sineInOut } from 'svelte/easing';
import { env } from '$env/dynamic/public'; import { PUBLIC_ENABLE_USERS_COMPANIES } from '$env/static/public';
const names = [ const names = [
{ label: 'Audience', color: '#3ADFEC' }, { label: 'Audience', color: '#3ADFEC' },
@@ -219,7 +219,7 @@
></iframe> ></iframe>
</div> </div>
{#if env.PUBLIC_ENABLE_USERS_COMPANIES} {#if PUBLIC_ENABLE_USERS_COMPANIES}
<div class="mb-[10%] px-[15%]"> <div class="mb-[10%] px-[15%]">
<h2 class="text-base font-semibold text-gray-900 lg:text-xl">Used at</h2> <h2 class="text-base font-semibold text-gray-900 lg:text-xl">Used at</h2>
<div class="flex w-full flex-row flex-wrap items-center justify-between gap-5 py-[5%]"> <div class="flex w-full flex-row flex-wrap items-center justify-between gap-5 py-[5%]">
+2 -2
View File
@@ -5,8 +5,8 @@
import StudentDashboard from '$lib/Home/StudentDashboard.svelte'; import StudentDashboard from '$lib/Home/StudentDashboard.svelte';
import MoreFeatures from '$lib/Home/MoreFeatures.svelte'; import MoreFeatures from '$lib/Home/MoreFeatures.svelte';
import Testimonial from '$lib/Home/Testimonial.svelte'; import Testimonial from '$lib/Home/Testimonial.svelte';
import { PUBLIC_ENABLE_FAQ } from '$env/static/public';
import { env } from '$env/dynamic/public';
import { onMount } from 'svelte'; import { onMount } from 'svelte';
onMount(() => { onMount(() => {
@@ -20,6 +20,6 @@
<Testimonial /> <Testimonial />
<MoreFeatures /> <MoreFeatures />
{#if env.PUBLIC_ENABLE_FAQ} {#if PUBLIC_ENABLE_FAQ}
<Faq /> <Faq />
{/if} {/if}