add paywall to reddit tracker

This commit is contained in:
MuslemRahimi 2024-11-22 17:07:38 +01:00
parent 5e3c61c505
commit 1a949a1f39
2 changed files with 40 additions and 15 deletions

View File

@ -512,6 +512,7 @@
class="flex flex-row items-center w-full text-sm sm:text-[1rem] text-white" class="flex flex-row items-center w-full text-sm sm:text-[1rem] text-white"
> >
{#each tabs as item, index} {#each tabs as item, index}
{#if data?.user?.tier === "Pro" || index === 0}
<label <label
on:click={() => changeTimePeriod(index)} on:click={() => changeTimePeriod(index)}
class="p-2 px-5 cursor-pointer {activeIdx === index class="p-2 px-5 cursor-pointer {activeIdx === index
@ -520,6 +521,26 @@
> >
{item.title} {item.title}
</label> </label>
{:else if data?.user?.tier !== "Pro"}
<a
href="/pricing"
class="flex flex-row items-center p-2 px-5 cursor-pointer {activeIdx ===
index
? 'text-white bg-[#27272A] sm:hover:bg-opacity-[0.95]'
: 'text-gray-400 sm:hover:text-white sm:hover:bg-[#27272A] sm:hover:bg-opacity-[0.95]'}"
>
<span class="">{item.title}</span>
<svg
class="ml-2 w-3.5 h-3.5"
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
>
</a>
{/if}
{/each} {/each}
</ul> </ul>
</nav> </nav>

View File

@ -22,7 +22,6 @@
import { page } from "$app/stores"; import { page } from "$app/stores";
import toast from "svelte-french-toast"; import toast from "svelte-french-toast";
import { convertTimestamp } from "$lib/utils"; import { convertTimestamp } from "$lib/utils";
import Markethour from "$lib/components/Markethour.svelte";
import AIScore from "$lib/components/AIScore.svelte"; import AIScore from "$lib/components/AIScore.svelte";
export let data; export let data;
@ -584,8 +583,6 @@
<div <div
class="hidden sm:flex flex-row w-full justify-between items-center" class="hidden sm:flex flex-row w-full justify-between items-center"
> >
<Markethour />
<!--Start Watchlist--> <!--Start Watchlist-->
{#if data?.user} {#if data?.user}
@ -762,11 +759,18 @@
{displayLegend?.change}% {displayLegend?.change}%
</div> </div>
<div class="mt-0.5 text-xs sm:text-sm"> <div class="mt-0.5 text-xs sm:text-sm">
{#if !$isOpen}
<span <span
class="block font-semibold sm:inline mb-0.5 sm:mb-0" class="block font-semibold sm:inline mb-0.5 sm:mb-0"
>At close:</span >At close:</span
> >
{/if}
{displayLegend?.date} {displayLegend?.date}
{#if $isOpen}
<span class="block sm:inline mb-0.5 sm:mb-0"
>- Market open</span
>
{/if}
</div> </div>
</div> </div>
{#if Object?.keys(prePostData)?.length !== 0} {#if Object?.keys(prePostData)?.length !== 0}