auth check in coin creation page
This commit is contained in:
parent
1b2d60905c
commit
db9c133bbb
1 changed files with 215 additions and 190 deletions
|
|
@ -12,6 +12,7 @@
|
||||||
import { CREATION_FEE, INITIAL_LIQUIDITY, TOTAL_COST } from '$lib/data/constants';
|
import { CREATION_FEE, INITIAL_LIQUIDITY, TOTAL_COST } from '$lib/data/constants';
|
||||||
import { toast } from 'svelte-sonner';
|
import { toast } from 'svelte-sonner';
|
||||||
import SEO from '$lib/components/self/SEO.svelte';
|
import SEO from '$lib/components/self/SEO.svelte';
|
||||||
|
import SignInConfirmDialog from '$lib/components/self/SignInConfirmDialog.svelte';
|
||||||
|
|
||||||
let name = $state('');
|
let name = $state('');
|
||||||
let symbol = $state('');
|
let symbol = $state('');
|
||||||
|
|
@ -112,6 +113,8 @@
|
||||||
isSubmitting = false;
|
isSubmitting = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let shouldSignIn = $state(false);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<SEO
|
<SEO
|
||||||
|
|
@ -120,7 +123,20 @@
|
||||||
keywords="create virtual cryptocurrency, coin creation game, launch crypto simulation, virtual token creation, cryptocurrency game creator"
|
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">
|
<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">
|
<div class="grid grid-cols-1 gap-6 lg:grid-cols-3">
|
||||||
<!-- Main Form Column -->
|
<!-- Main Form Column -->
|
||||||
<div class="lg:col-span-2">
|
<div class="lg:col-span-2">
|
||||||
|
|
@ -169,7 +185,13 @@
|
||||||
<!-- Name Input -->
|
<!-- Name Input -->
|
||||||
<div class="space-y-2">
|
<div class="space-y-2">
|
||||||
<Label for="name">Coin Name</Label>
|
<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}
|
{#if nameError}
|
||||||
<p class="text-destructive text-xs">{nameError}</p>
|
<p class="text-destructive text-xs">{nameError}</p>
|
||||||
{:else}
|
{:else}
|
||||||
|
|
@ -183,7 +205,8 @@
|
||||||
<div class="space-y-2">
|
<div class="space-y-2">
|
||||||
<Label for="symbol">Symbol</Label>
|
<Label for="symbol">Symbol</Label>
|
||||||
<div class="relative">
|
<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
|
>*</span
|
||||||
>
|
>
|
||||||
<Input
|
<Input
|
||||||
|
|
@ -301,7 +324,8 @@
|
||||||
<div>
|
<div>
|
||||||
<p class="font-medium">Price Discovery</p>
|
<p class="font-medium">Price Discovery</p>
|
||||||
<p class="text-muted-foreground text-sm">
|
<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>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -323,6 +347,7 @@
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
|
||||||
Reference in a new issue