Skip to content

Commit

Permalink
chore: improve Airdrop108 page
Browse files Browse the repository at this point in the history
  • Loading branch information
zensh committed Oct 31, 2024
1 parent 4d2eed8 commit e7a6130
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 4 deletions.
25 changes: 25 additions & 0 deletions proposals/proposal-208.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

# Load the environment variables
source "$(pwd)"/proposals/env.sh

# build and get batch_id, evidence:
# dfx deploy ic_panda_frontend --ic --by-proposal

export BLOB="$(didc encode --format blob '(record {batch_id=63:nat; evidence=blob "\ea\16\99\ef\0a\1e\09\ec\61\b2\5c\74\b1\c3\bc\9f\3a\45\74\13\5d\e3\65\f6\b6\d9\7c\0a\59\9f\f7\5f"})')"

quill sns make-proposal --canister-ids-file ./sns_canister_ids.json --pem-file $PROPOSAL_PEM_FILE $PROPOSAL_NEURON_ID --proposal "(
record {
title = \"Execute commit_proposed_batch() to release ic_panda_frontend v2.6.5\";
url = \"https://panda.fans/\";
summary = \"This proposal executes commit_proposed_batch() on c63a7-6yaaa-aaaap-ab3gq-cai to release ic_panda_frontend v2.6.5.\n\n1. chore: improve airdrop 108 page.\";
action = opt variant {
ExecuteGenericNervousSystemFunction = record {
function_id = 1000 : nat64;
payload = ${BLOB};
}
};
}
)" > proposal-message.json

# quill send proposal-message.json
2 changes: 1 addition & 1 deletion src/ic_message_frontend/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default defineConfig({
short_name: 'dMsg',
name: 'dMsg.net',
description:
'ICPanda Message (dMsg) is a decentralized end-to-end encrypted messaging application fully running on the Internet Computer blockchain.',
'ICPanda Message (dMsg.net) is a decentralized end-to-end encrypted messaging application fully running on the Internet Computer blockchain.',
icons: [
{
src: '/_assets/favicons/android-chrome-192x192.png',
Expand Down
2 changes: 1 addition & 1 deletion src/ic_panda_frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,5 @@
"test": "vitest run"
},
"type": "module",
"version": "2.6.4"
"version": "2.6.5"
}
17 changes: 16 additions & 1 deletion src/ic_panda_frontend/src/lib/components/airdrop/Home.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
function getStatus(status: number) {
switch (status) {
case 0:
return 'Not Started'
return `Will start at ${new Date(1731283200000).toLocaleString()}`
case 1:
return 'Started'
case 2:
Expand All @@ -48,6 +48,15 @@
}
}
function estimateAirdrop(airdropOutput: Airdrops108Output) {
return Math.round(
Number(
airdropOutput.airdrops.reduce((prev, cur) => prev + cur.weight, 0n) /
token_1
) * airdropOutput.tokens_per_weight
)
}
onMount(() => {
const { abort } = toastRun(async () => {
await getAirdropOutput()
Expand Down Expand Up @@ -117,6 +126,7 @@
class="card mx-auto mt-4 flex w-fit flex-col border-gray/10 bg-transparent p-4 *:justify-start"
>
{#if airdropOutput}
{@const tokens = estimateAirdrop(airdropOutput)}
<div class="text-gray/80 *:text-pretty *:break-all">
<div class="*:text-pretty *:break-all">
<p class="text-panda">
Expand All @@ -135,6 +145,11 @@
? 'YES'
: 'NO'}</p
>
<p>
Estimate airdrop tokens: <b
>{`${getShortNumber(tokens)} (${tokens})`}</b
>
</p>
<ul class="mt-2">
{#each airdropOutput.airdrops as airdrop}
<li
Expand Down
2 changes: 1 addition & 1 deletion src/ic_panda_frontend/src/lib/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const src = globalThis.location?.href || ''

export const APP_VERSION = '2.6.4'
export const APP_VERSION = '2.6.5'
export const IS_LOCAL = src.includes('localhost') || src.includes('127.0.0.1')
export const ENV = IS_LOCAL ? 'local' : 'ic'
export const APP_ORIGIN = IS_LOCAL
Expand Down

0 comments on commit e7a6130

Please sign in to comment.