Skip to content

Commit

Permalink
Cleanup messages (#2217)
Browse files Browse the repository at this point in the history
* Fix messaging

* Fix logic

* Update error
  • Loading branch information
harsh-mn-yral authored Jun 4, 2024
1 parent 9ef3e62 commit 084de13
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 46 deletions.
43 changes: 10 additions & 33 deletions packages/web-client/src/routes/migrate/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import Button from '@hnn/components/button/Button.svelte'
import { authState } from '$lib/stores/auth'
let loading = false
let selected: 'yes' | 'no' | undefined = undefined
</script>

<svelte:head>
Expand Down Expand Up @@ -88,39 +87,17 @@ let selected: 'yes' | 'no' | undefined = undefined
</div>
<div class="h-1 w-10 border-t border-dashed border-white"></div>
{#if $authState.isLoggedIn}
<div class="text-sm font-medium">
Have you logged in to yral.com with your google ID? <span
class="text-red-500">
*
</span>
<div class="flex gap-2 pt-2">
<button
on:click={() => (selected = 'yes')}
class="rounded-md px-8 py-2
{selected === 'yes' ? 'bg-primary/90' : 'bg-white/10'}">
Yes
</button>
<button
on:click={() => (selected = 'no')}
class="rounded-md px-8 py-2
{selected === 'no' ? 'bg-primary/90' : 'bg-white/10'}">
No
</button>
</div>
<div class="text-center text-sm font-medium">
Go to <a
target="_blank"
class="font-bold text-[#E2017B] underline"
href="https://yral.com">
Yral.com
</a>
and get your Yral Principal id before proceeding.
</div>
{#if selected === 'yes'}
<Button class="w-full" href="/migrate/form">Proceed</Button>
{:else if selected === 'no'}
<div class="text-center text-sm font-medium">
Go to <a
target="_blank"
class="font-bold text-[#E2017B] underline"
href="https://yral.com">
Yral.com
</a>
and get your Yral Principal id before proceeding.
</div>
{/if}

<Button class="w-full" href="/migrate/form">Proceed</Button>
{:else}
<Button class="w-full" on:click={() => ($authState.showLogin = true)}>
Login
Expand Down
21 changes: 8 additions & 13 deletions packages/web-client/src/routes/migrate/form/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ async function transfer() {
yralCanisterId: canId,
})
error = Object.keys(res.Err)?.[0]
?.split(/(?=[A-Z])/)
?.join(' ')
step = 1
}
} finally {
Expand Down Expand Up @@ -179,7 +181,7 @@ $: if (loggedIn) {
<div
class="mx-auto flex h-full w-full max-w-sm flex-col items-center gap-10 overflow-y-auto px-8 py-8 lg:max-w-lg">
<div
class="relative mt-20 flex w-full flex-col items-center gap-2 px-8">
class="relative z-0 mt-20 flex w-full flex-col items-center gap-2 px-8">
<img src={bigCoin} alt="yral" />
</div>
{#if transferred}
Expand Down Expand Up @@ -223,12 +225,12 @@ $: if (loggedIn) {
</div>
<a
target="_blank"
class="text-3xl font-bold uppercase text-[#E2017B]"
class="z-[1] text-3xl font-bold uppercase text-[#E2017B]"
href="https://yral.com">
Yral.com
</a>
</div>
<a href="/migrate-faq" class="font-bold text-primary underline">
<a href="/migrate-faq" class="z-[1] font-bold text-primary underline">
Learn more about the transfer here
</a>
<div class="h-1 w-10 border-t border-dashed border-white"></div>
Expand Down Expand Up @@ -260,16 +262,9 @@ $: if (loggedIn) {
bind:value={yralId}
class="w-full rounded-md bg-white/10 py-4" />

<div class="flex gap-2">
<input
checked
type="checkbox"
class="h-4 w-4 rounded border-2 border-white bg-transparent text-primary focus:ring-0" />

<div class="text-sm">
Do you want to transfer your tokens from HON wallet to “xxx” YRAL
wallet?
</div>
<div class="text-sm">
Note: Both the posts and the wallet balance will be transferred to
your yral account.
</div>

{#if error}
Expand Down

0 comments on commit 084de13

Please sign in to comment.