Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show SNS details in airdrop form #2005

Merged
merged 6 commits into from
Sep 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/web-client/src/components/input/Input.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ onMount(() => {
on:change
on:focus
on:blur
class="grow border-none py-3 px-4 focus:ring-transparent disabled:opacity-50 {exportClass}" />
on:paste
class="grow border-none px-4 py-3 focus:ring-transparent disabled:opacity-50 {exportClass}" />
2 changes: 2 additions & 0 deletions packages/web-client/src/lib/helpers/airdrop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export async function airdropEntryDetails(principalId: string) {
return body.doc as {
FinalCOYNWalletBalance: string
FinalHotTokens: number
splitNeuronId?: string
nnsId?: string
}
}
return false
Expand Down
2 changes: 1 addition & 1 deletion packages/web-client/src/lib/utils/sleep.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default function sleep(ms) {
export default function sleep(ms: number) {
return new Promise((resolve) => setTimeout(resolve, ms))
}
29 changes: 23 additions & 6 deletions packages/web-client/src/routes/airdrop/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ let wallet = {
hot: 0,
loading: true,
}
let transferDetails = {
nnsId: '',
neuronId: '',
}

async function checkIfCompleted() {
if ($authState.idString) {
Expand All @@ -29,6 +33,8 @@ async function checkIfCompleted() {
} else {
wallet.coyn = res?.FinalCOYNWalletBalance
wallet.hot = res?.FinalHotTokens
res.splitNeuronId && (transferDetails.neuronId = res.splitNeuronId)
res.nnsId && (transferDetails.nnsId = res.nnsId)
wallet.loading = false
participatedForAirdrop = true
const nns = await isNNSIdRegistered($authState.idString)
Expand Down Expand Up @@ -94,12 +100,23 @@ $: !authorized && (loading = false)
</div>
</div>
{/if}
<div class="py-4 text-center text-sm">
The HOT tokens will be transferred to your NNS wallet by our team
over the course of a few months as we go through the process
manually with over 16,000 winners. Please be patient and check our
socials for updates.
</div>
{#if transferDetails.nnsId && transferDetails.neuronId}
<div class="py-4 text-center text-sm">
Your reward has been transferred to your NNS dapp account with
ID {transferDetails.nnsId}. The neuron ID is
<span class="underline">
{transferDetails.neuronId}
</span>
.
</div>
{:else}
<div class="py-4 text-center text-sm">
The HOT tokens will be transferred to your NNS wallet by our
team over the course of a few months as we go through the
process manually with over 16,000 winners. Please be patient and
check our socials for updates.
</div>
{/if}

<Button href="/hotornot" class="w-full">Play to earn</Button>

Expand Down
5 changes: 3 additions & 2 deletions packages/web-client/src/routes/profile/[id]/edit/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { goto } from '$app/navigation'
import { registerEvent } from '$components/analytics/GA.svelte'
import { individualUser, userIndex } from '$lib/helpers/backend'
import goBack from '$lib/utils/goBack'
import Icon from '$components/icon/Icon.svelte'

export let data: PageData

Expand Down Expand Up @@ -86,7 +85,7 @@ async function saveChanges() {
} else if (!usernameRegex.test(values.username.trim())) {
error = 'Username not allowed'
loading = false
Log({ error }, 'warn')
Log('warn', 'Username not allowed')
return
} else if (!username_set && (await isUsernameTaken())) {
error = 'This username is already taken'
Expand Down Expand Up @@ -219,6 +218,7 @@ $: userId = username_set
disabled={loading}
bind:value={values.name}
type="text"
on:paste={(e) => e.preventDefault()}
maxlength={40}
placeholder="Enter your name here"
class="w-full rounded-md bg-white/10 py-4" />
Expand All @@ -230,6 +230,7 @@ $: userId = username_set
bind:value={values.username}
on:keydown={filterUsernameKeystrokes}
type="text"
on:paste={(e) => e.preventDefault()}
maxlength={20}
placeholder="Enter your username here"
class="placeholder:norma w-full rounded-md bg-white/10 py-4 lowercase placeholder:normal-case" />
Expand Down
Loading