diff --git a/website/src/lib/components/self/CommentSection.svelte b/website/src/lib/components/self/CommentSection.svelte index d7af7d6..c49d6dd 100644 --- a/website/src/lib/components/self/CommentSection.svelte +++ b/website/src/lib/components/self/CommentSection.svelte @@ -219,7 +219,7 @@ {:else}

Sign in to join the discussion

- +
{/if} diff --git a/website/src/routes/coin/[coinSymbol]/+page.svelte b/website/src/routes/coin/[coinSymbol]/+page.svelte index 3eb3d85..3a36913 100644 --- a/website/src/routes/coin/[coinSymbol]/+page.svelte +++ b/website/src/routes/coin/[coinSymbol]/+page.svelte @@ -27,6 +27,7 @@ import { getPublicUrl, getTimeframeInSeconds, timeToLocal } from '$lib/utils.js'; import { websocketController, type PriceUpdate, isConnectedStore } from '$lib/stores/websocket'; import SEO from '$lib/components/self/SEO.svelte'; + import SignInConfirmDialog from '$lib/components/self/SignInConfirmDialog.svelte'; const { data } = $props(); let coinSymbol = $derived(data.coinSymbol); @@ -39,6 +40,7 @@ let sellModalOpen = $state(false); let selectedTimeframe = $state('1m'); let lastPriceUpdateTime = 0; + let shouldSignIn = $state(false); let previousCoinSymbol = $state(null); @@ -370,6 +372,8 @@ imageAlt={coin ? `${coin.name} (${coin.symbol}) logo` : `${coinSymbol} cryptocurrency logo`} /> + + {#if coin}

Sign in to start trading

- + {/if} diff --git a/website/src/routes/gambling/+page.svelte b/website/src/routes/gambling/+page.svelte index 96183d1..5f00d20 100644 --- a/website/src/routes/gambling/+page.svelte +++ b/website/src/routes/gambling/+page.svelte @@ -55,12 +55,7 @@
Sign in to start gambling

You need an account to place bets

- +
{:else} diff --git a/website/src/routes/portfolio/+page.svelte b/website/src/routes/portfolio/+page.svelte index 56a4d4d..a568344 100644 --- a/website/src/routes/portfolio/+page.svelte +++ b/website/src/routes/portfolio/+page.svelte @@ -11,6 +11,7 @@ import { goto } from '$app/navigation'; import { USER_DATA } from '$lib/stores/user-data'; import SendMoneyModal from '$lib/components/self/SendMoneyModal.svelte'; + import SignInConfirmDialog from '$lib/components/self/SignInConfirmDialog.svelte'; // TODO: add type definitions let portfolioData = $state(null); @@ -18,6 +19,7 @@ let loading = $state(true); let error = $state(null); let sendMoneyModalOpen = $state(false); + let shouldSignIn = $state(false); onMount(async () => { await Promise.all([fetchPortfolioData(), fetchRecentTransactions()]); @@ -234,6 +236,7 @@ /> +
@@ -241,12 +244,14 @@

Portfolio

Manage your investments and transactions

-
- -
+ {#if $USER_DATA} +
+ +
+ {/if}
{#if loading} @@ -257,7 +262,7 @@
You need to be logged in to view your portfolio
- + {:else if error} diff --git a/website/src/routes/settings/+page.svelte b/website/src/routes/settings/+page.svelte index 5750af0..d60e9db 100644 --- a/website/src/routes/settings/+page.svelte +++ b/website/src/routes/settings/+page.svelte @@ -16,7 +16,9 @@ import { USER_DATA } from '$lib/stores/user-data'; import * as Dialog from '$lib/components/ui/dialog'; import SEO from '$lib/components/self/SEO.svelte'; + import SignInConfirmDialog from '$lib/components/self/SignInConfirmDialog.svelte'; + let shouldSignIn = $state(false); let name = $state($USER_DATA?.name || ''); let bio = $state($USER_DATA?.bio ?? ''); let username = $state($USER_DATA?.username || ''); @@ -36,7 +38,7 @@ avatarFile !== undefined ); - let fileInput: HTMLInputElement; + let fileInput: HTMLInputElement | undefined = $state(undefined); let loading = $state(false); let usernameAvailable: boolean | null = $state(null); @@ -66,7 +68,7 @@ }); function handleAvatarClick() { - fileInput.click(); + fileInput?.click(); } function handleAvatarChange(e: Event) { const f = (e.target as HTMLInputElement).files?.[0]; @@ -293,6 +295,16 @@

Settings

+ {#if !$USER_DATA} +
+
+
+ You need to be logged in to view your settings +
+ +
+
+{:else}
@@ -476,6 +488,7 @@
+ {/if}
@@ -519,4 +532,4 @@ - + \ No newline at end of file