auth check in coin creation page

This commit is contained in:
Face 2025-05-30 14:27:25 +03:00
parent 1b2d60905c
commit db9c133bbb

View file

@ -12,6 +12,7 @@
import { CREATION_FEE, INITIAL_LIQUIDITY, TOTAL_COST } from '$lib/data/constants';
import { toast } from 'svelte-sonner';
import SEO from '$lib/components/self/SEO.svelte';
import SignInConfirmDialog from '$lib/components/self/SignInConfirmDialog.svelte';
let name = $state('');
let symbol = $state('');
@ -112,6 +113,8 @@
isSubmitting = false;
}
}
let shouldSignIn = $state(false);
</script>
<SEO
@ -120,7 +123,20 @@
keywords="create virtual cryptocurrency, coin creation game, launch crypto simulation, virtual token creation, cryptocurrency game creator"
/>
<SignInConfirmDialog bind:open={shouldSignIn} />
<div class="container mx-auto max-w-5xl px-4 py-6">
{#if !$PORTFOLIO_DATA}
<div class="flex h-96 items-center justify-center">
<div class="text-center">
<div class="text-muted-foreground mb-4 text-xl">Sign in to create your own coin</div>
<p class="text-muted-foreground mb-4 text-sm">You need an account to create coins.</p>
<Button onclick={() => (shouldSignIn = true)} class="w-fit">
Sign in to continue
</Button>
</div>
</div>
{:else}
<div class="grid grid-cols-1 gap-6 lg:grid-cols-3">
<!-- Main Form Column -->
<div class="lg:col-span-2">
@ -169,7 +185,13 @@
<!-- Name Input -->
<div class="space-y-2">
<Label for="name">Coin Name</Label>
<Input id="name" type="text" bind:value={name} placeholder="e.g., Bitcoin" required />
<Input
id="name"
type="text"
bind:value={name}
placeholder="e.g., Bitcoin"
required
/>
{#if nameError}
<p class="text-destructive text-xs">{nameError}</p>
{:else}
@ -183,7 +205,8 @@
<div class="space-y-2">
<Label for="symbol">Symbol</Label>
<div class="relative">
<span class="text-muted-foreground absolute left-3 top-1/2 -translate-y-1/2 text-sm"
<span
class="text-muted-foreground absolute left-3 top-1/2 -translate-y-1/2 text-sm"
>*</span
>
<Input
@ -301,7 +324,8 @@
<div>
<p class="font-medium">Price Discovery</p>
<p class="text-muted-foreground text-sm">
Token price increases automatically as more people buy, following a bonding curve
Token price increases automatically as more people buy, following a bonding
curve
</p>
</div>
</div>
@ -323,6 +347,7 @@
</Card>
</div>
</div>
{/if}
</div>
<style>