adding paywall

This commit is contained in:
MuslemRahimi 2024-06-17 23:09:52 +02:00
parent 9904ff2dd0
commit 4bd42ace22
7 changed files with 48 additions and 15 deletions

View File

@ -72,6 +72,7 @@ $: {
</div> </div>
</div> </div>
{#if data?.user?.tier === 'Pro'}
<!--Start Header--> <!--Start Header-->
<div role="tablist" class="-mt-2 w-11/12 sm:w-56"> <div role="tablist" class="-mt-2 w-11/12 sm:w-56">
@ -92,7 +93,6 @@ $: {
</div> </div>
</div> </div>
{#if data?.user?.tier === 'Pro'}
<!--End Header--> <!--End Header-->
<span class="text-gray-200 text-xs sm:text-[0.85rem] italic mt-6 sm:ml-auto"> <span class="text-gray-200 text-xs sm:text-[0.85rem] italic mt-6 sm:ml-auto">
@ -112,7 +112,7 @@ $: {
</span> </span>
</div> </div>
{:else} {:else}
<div class="bg-[#202020] sm:bg-opacity-[0.5] text-sm sm:text-[1rem] rounded-md w-full p-4 min-h-24 mt-4 text-white m-auto flex justify-center items-center text-center font-semibold"> <div class="shadow-lg shadow-bg-[#000] bg-[#202020] sm:bg-opacity-[0.5] text-sm sm:text-[1rem] rounded-md w-full p-4 min-h-24 mt-4 text-white m-auto flex justify-center items-center text-center font-semibold">
<svg class="mr-1.5 w-5 h-5 inline-block"xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#A3A3A3" d="M17 9V7c0-2.8-2.2-5-5-5S7 4.2 7 7v2c-1.7 0-3 1.3-3 3v7c0 1.7 1.3 3 3 3h10c1.7 0 3-1.3 3-3v-7c0-1.7-1.3-3-3-3M9 7c0-1.7 1.3-3 3-3s3 1.3 3 3v2H9z"/></svg> <svg class="mr-1.5 w-5 h-5 inline-block"xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#A3A3A3" d="M17 9V7c0-2.8-2.2-5-5-5S7 4.2 7 7v2c-1.7 0-3 1.3-3 3v7c0 1.7 1.3 3 3 3h10c1.7 0 3-1.3 3-3v-7c0-1.7-1.3-3-3-3M9 7c0-1.7 1.3-3 3-3s3 1.3 3 3v2H9z"/></svg>
Unlock content with <a class="inline-block ml-2 text-blue-400 hover:sm:text-white" href="/pricing">Pro Subscription</a> Unlock content with <a class="inline-block ml-2 text-blue-400 hover:sm:text-white" href="/pricing">Pro Subscription</a>
</div> </div>

View File

@ -3,9 +3,11 @@
import { displayCompanyName, stockTicker, screenWidth, userRegion, getCache, setCache} from '$lib/store'; import { displayCompanyName, stockTicker, screenWidth, userRegion, getCache, setCache} from '$lib/store';
import InfoModal from '$lib/components/InfoModal.svelte'; import InfoModal from '$lib/components/InfoModal.svelte';
import { Chart } from 'svelte-echarts' import { Chart } from 'svelte-echarts'
import { abbreviateNumber } from "$lib/utils";
import Lazy from 'svelte-lazy'; import Lazy from 'svelte-lazy';
export let data;
let isLoaded = false; let isLoaded = false;
const usRegion = ['cle1','iad1','pdx1','sfo1']; const usRegion = ['cle1','iad1','pdx1','sfo1'];
@ -190,6 +192,7 @@ $: {
/> />
</div> </div>
{#if data?.user?.tier === 'Pro'}
{#if isLoaded} {#if isLoaded}
{#if rawData?.length !== 0} {#if rawData?.length !== 0}
<div class="p-3 sm:p-0 mt-2 pb-8 sm:pb-2 rounded-lg bg-[#202020] sm:bg-[#0F0F0F]"> <div class="p-3 sm:p-0 mt-2 pb-8 sm:pb-2 rounded-lg bg-[#202020] sm:bg-[#0F0F0F]">
@ -254,6 +257,13 @@ $: {
</div> </div>
</div> </div>
{/if} {/if}
{:else}
<div class="shadow-lg shadow-bg-[#000] bg-[#202020] sm:bg-opacity-[0.5] text-sm sm:text-[1rem] rounded-md w-full p-4 min-h-24 mt-4 text-white m-auto flex justify-center items-center text-center font-semibold">
<svg class="mr-1.5 w-5 h-5 inline-block"xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#A3A3A3" d="M17 9V7c0-2.8-2.2-5-5-5S7 4.2 7 7v2c-1.7 0-3 1.3-3 3v7c0 1.7 1.3 3 3 3h10c1.7 0 3-1.3 3-3v-7c0-1.7-1.3-3-3-3M9 7c0-1.7 1.3-3 3-3s3 1.3 3 3v2H9z"/></svg>
Unlock content with <a class="inline-block ml-2 text-blue-400 hover:sm:text-white" href="/pricing">Pro Subscription</a>
</div>
{/if}
</main> </main>
</section> </section>

View File

@ -6,6 +6,8 @@
import { abbreviateNumber } from "$lib/utils"; import { abbreviateNumber } from "$lib/utils";
import Lazy from 'svelte-lazy'; import Lazy from 'svelte-lazy';
export let data;
let isLoaded = false; let isLoaded = false;
const usRegion = ['cle1','iad1','pdx1','sfo1']; const usRegion = ['cle1','iad1','pdx1','sfo1'];
@ -223,6 +225,7 @@ $: {
/> />
</div> </div>
{#if data?.user?.tier === 'Pro'}
{#if isLoaded} {#if isLoaded}
{#if rawData?.length !== 0} {#if rawData?.length !== 0}
@ -248,7 +251,7 @@ $: {
</span> </span>
{/if} trend. {/if} trend.
</div> </div>
</div> </div>
<div class="p-3 sm:p-0 pb-8 sm:pb-2 rounded-lg bg-[#202020] sm:bg-[#0F0F0F]"> <div class="p-3 sm:p-0 pb-8 sm:pb-2 rounded-lg bg-[#202020] sm:bg-[#0F0F0F]">
@ -305,7 +308,14 @@ $: {
<span class="loading loading-spinner loading-md"></span> <span class="loading loading-spinner loading-md"></span>
</label> </label>
</div> </div>
</div> </div>
{/if}
{:else}
<div class="shadow-lg shadow-bg-[#000] bg-[#202020] sm:bg-opacity-[0.5] text-sm sm:text-[1rem] rounded-md w-full p-4 min-h-24 mt-4 text-white m-auto flex justify-center items-center text-center font-semibold">
<svg class="mr-1.5 w-5 h-5 inline-block"xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#A3A3A3" d="M17 9V7c0-2.8-2.2-5-5-5S7 4.2 7 7v2c-1.7 0-3 1.3-3 3v7c0 1.7 1.3 3 3 3h10c1.7 0 3-1.3 3-3v-7c0-1.7-1.3-3-3-3M9 7c0-1.7 1.3-3 3-3s3 1.3 3 3v2H9z"/></svg>
Unlock content with <a class="inline-block ml-2 text-blue-400 hover:sm:text-white" href="/pricing">Pro Subscription</a>
</div>
{/if} {/if}
</main> </main>

View File

@ -6,6 +6,9 @@
import { abbreviateNumber } from "$lib/utils"; import { abbreviateNumber } from "$lib/utils";
import Lazy from 'svelte-lazy'; import Lazy from 'svelte-lazy';
export let data;
let isLoaded = false; let isLoaded = false;
const usRegion = ['cle1','iad1','pdx1','sfo1']; const usRegion = ['cle1','iad1','pdx1','sfo1'];
@ -168,6 +171,7 @@ $: {
/> />
</div> </div>
{#if data?.user?.tier === 'Pro'}
{#if isLoaded} {#if isLoaded}
{#if Object?.keys(rawData)?.length !== 0} {#if Object?.keys(rawData)?.length !== 0}
@ -273,6 +277,13 @@ $: {
</div> </div>
</div> </div>
{/if} {/if}
{:else}
<div class="shadow-lg shadow-bg-[#000] bg-[#202020] sm:bg-opacity-[0.5] text-sm sm:text-[1rem] rounded-md w-full p-4 min-h-24 mt-4 text-white m-auto flex justify-center items-center text-center font-semibold">
<svg class="mr-1.5 w-5 h-5 inline-block"xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#A3A3A3" d="M17 9V7c0-2.8-2.2-5-5-5S7 4.2 7 7v2c-1.7 0-3 1.3-3 3v7c0 1.7 1.3 3 3 3h10c1.7 0 3-1.3 3-3v-7c0-1.7-1.3-3-3-3M9 7c0-1.7 1.3-3 3-3s3 1.3 3 3v2H9z"/></svg>
Unlock content with <a class="inline-block ml-2 text-blue-400 hover:sm:text-white" href="/pricing">Pro Subscription</a>
</div>
{/if}
</main> </main>
</section> </section>

View File

@ -53,7 +53,8 @@ $: {
id={"whyPriceMovedInfo"} id={"whyPriceMovedInfo"}
/> />
</div> </div>
{#if data?.user?.tier === 'Pro'}
{#if wiim?.length !== 0} {#if wiim?.length !== 0}
<div class="mt-7"> <div class="mt-7">
{#each (showFullHistory ? wiim : wiim?.slice(0,2)) as item, index} {#each (showFullHistory ? wiim : wiim?.slice(0,2)) as item, index}
@ -125,14 +126,15 @@ $: {
<svg class="w-10 h-10 transform {showFullHistory ? 'rotate-180' : ''} " xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#2A323C" d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm0 13.5L7.5 11l1.42-1.41L12 12.67l3.08-3.08L16.5 11L12 15.5z"/></svg> <svg class="w-10 h-10 transform {showFullHistory ? 'rotate-180' : ''} " xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#2A323C" d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm0 13.5L7.5 11l1.42-1.41L12 12.67l3.08-3.08L16.5 11L12 15.5z"/></svg>
</label> </label>
{/if} {/if}
{:else}
<h2 class="mt-10 mb-5 flex justify-center items-center text-3xl font-bold text-slate-700 m-auto">
No data available
<svg class="w-10 sm:w-12 inline-block" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#334155" d="M18.68 12.32a4.49 4.49 0 0 0-6.36.01a4.49 4.49 0 0 0 0 6.36a4.508 4.508 0 0 0 5.57.63L21 22.39L22.39 21l-3.09-3.11c1.13-1.77.87-4.09-.62-5.57m-1.41 4.95c-.98.98-2.56.97-3.54 0c-.97-.98-.97-2.56.01-3.54c.97-.97 2.55-.97 3.53 0c.97.98.97 2.56 0 3.54M10.9 20.1a6.527 6.527 0 0 1-1.48-2.32C6.27 17.25 4 15.76 4 14v3c0 2.21 3.58 4 8 4c-.4-.26-.77-.56-1.1-.9M4 9v3c0 1.68 2.07 3.12 5 3.7v-.2c0-.93.2-1.85.58-2.69C6.34 12.3 4 10.79 4 9m8-6C7.58 3 4 4.79 4 7c0 2 3 3.68 6.85 4h.05c1.2-1.26 2.86-2 4.6-2c.91 0 1.81.19 2.64.56A3.215 3.215 0 0 0 20 7c0-2.21-3.58-4-8-4Z"/></svg>
</h2>
{/if} {/if}
{:else}
<div class="shadow-lg shadow-bg-[#000] bg-[#202020] sm:bg-opacity-[0.5] text-sm sm:text-[1rem] rounded-md w-full p-4 min-h-24 mt-4 text-white m-auto flex justify-center items-center text-center font-semibold">
<svg class="mr-1.5 w-5 h-5 inline-block"xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#A3A3A3" d="M17 9V7c0-2.8-2.2-5-5-5S7 4.2 7 7v2c-1.7 0-3 1.3-3 3v7c0 1.7 1.3 3 3 3h10c1.7 0 3-1.3 3-3v-7c0-1.7-1.3-3-3-3M9 7c0-1.7 1.3-3 3-3s3 1.3 3 3v2H9z"/></svg>
Unlock content with <a class="inline-block ml-2 text-blue-400 hover:sm:text-white" href="/pricing">Pro Subscription</a>
</div>
{/if}
</main> </main>
</section> </section>

View File

@ -1337,7 +1337,7 @@ async function initializePrice() {
<Lazy> <Lazy>
<div class="w-full mt-10 sm:mt-5 m-auto sm:pl-6 sm:pb-6 sm:pt-6 {!$retailVolumeComponent ? 'hidden' : ''}"> <div class="w-full mt-10 sm:mt-5 m-auto sm:pl-6 sm:pb-6 sm:pt-6 {!$retailVolumeComponent ? 'hidden' : ''}">
{#await import('$lib/components/RetailVolume.svelte') then {default: Comp}} {#await import('$lib/components/RetailVolume.svelte') then {default: Comp}}
<svelte:component this={Comp} /> <svelte:component this={Comp} data={data}/>
{/await} {/await}
</div> </div>
</Lazy> </Lazy>

View File

@ -1342,7 +1342,7 @@ function changeChartType() {
<Lazy> <Lazy>
<div class="w-full mt-10 sm:mt-5 m-auto sm:pl-6 sm:pb-6 sm:pt-6 {!$retailVolumeComponent ? 'hidden' : ''}"> <div class="w-full mt-10 sm:mt-5 m-auto sm:pl-6 sm:pb-6 sm:pt-6 {!$retailVolumeComponent ? 'hidden' : ''}">
{#await import('$lib/components/RetailVolume.svelte') then {default: Comp}} {#await import('$lib/components/RetailVolume.svelte') then {default: Comp}}
<svelte:component this={Comp} /> <svelte:component this={Comp} data={data} />
{/await} {/await}
</div> </div>
</Lazy> </Lazy>
@ -1351,7 +1351,7 @@ function changeChartType() {
<Lazy> <Lazy>
<div class="w-full mt-10 sm:mt-5 m-auto sm:pl-6 sm:pb-6 sm:pt-6"> <div class="w-full mt-10 sm:mt-5 m-auto sm:pl-6 sm:pb-6 sm:pt-6">
{#await import('$lib/components/ShareStatistics.svelte') then {default: Comp}} {#await import('$lib/components/ShareStatistics.svelte') then {default: Comp}}
<svelte:component this={Comp} /> <svelte:component this={Comp} data={data}/>
{/await} {/await}
</div> </div>
</Lazy> </Lazy>