Unified theme for all Sign in buttons
Um, so I made all the Sign in buttons look the same now - same like styling and functiounality across all of them. Also, the button that used to send people to /login (which doesn’t even exist .-. ) now opens the sign-in popup instead. Did the same for the one on the coinSymbol page so no more redirect to "/", it just opens the popup now. Oh, and the comments section button also opens the Popup. Just annoyed me that they looked differently and redirected to 404 Pages.
This commit is contained in:
parent
8b5f341819
commit
f9c2732736
5 changed files with 35 additions and 18 deletions
|
|
@ -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<any>(null);
|
||||
|
|
@ -18,6 +19,7 @@
|
|||
let loading = $state(true);
|
||||
let error = $state<string | null>(null);
|
||||
let sendMoneyModalOpen = $state(false);
|
||||
let shouldSignIn = $state(false);
|
||||
|
||||
onMount(async () => {
|
||||
await Promise.all([fetchPortfolioData(), fetchRecentTransactions()]);
|
||||
|
|
@ -234,6 +236,7 @@
|
|||
/>
|
||||
|
||||
<SendMoneyModal bind:open={sendMoneyModalOpen} onSuccess={handleTransferSuccess} />
|
||||
<SignInConfirmDialog bind:open={shouldSignIn} />
|
||||
|
||||
<div class="container mx-auto max-w-7xl p-6">
|
||||
<div class="mb-6 flex flex-col items-start justify-between gap-4 sm:flex-row sm:items-center">
|
||||
|
|
@ -241,12 +244,14 @@
|
|||
<h1 class="text-3xl font-bold">Portfolio</h1>
|
||||
<p class="text-muted-foreground">Manage your investments and transactions</p>
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<Button onclick={() => (sendMoneyModalOpen = true)}>
|
||||
<Send class="h-4 w-4" />
|
||||
Send Money
|
||||
</Button>
|
||||
</div>
|
||||
{#if $USER_DATA}
|
||||
<div class="flex gap-2">
|
||||
<Button onclick={() => (sendMoneyModalOpen = true)}>
|
||||
<Send class="h-4 w-4" />
|
||||
Send Money
|
||||
</Button>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
{#if loading}
|
||||
|
|
@ -257,7 +262,7 @@
|
|||
<div class="text-muted-foreground mb-4 text-xl">
|
||||
You need to be logged in to view your portfolio
|
||||
</div>
|
||||
<Button onclick={() => goto('/login')}>Log In</Button>
|
||||
<Button onclick={() => (shouldSignIn = true)}>Sign In</Button>
|
||||
</div>
|
||||
</div>
|
||||
{:else if error}
|
||||
|
|
|
|||
Reference in a new issue