Skip to content

Commit

Permalink
fixed functionality by reverting dep updates. polish style some more
Browse files Browse the repository at this point in the history
  • Loading branch information
brenzi committed May 8, 2024
1 parent 7b313e1 commit 4180405
Show file tree
Hide file tree
Showing 6 changed files with 606 additions and 1,081 deletions.
11 changes: 7 additions & 4 deletions components/CheckWalletTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,19 @@
<div>
<NuxtLink
target="blank"
class="mb-5 btn btn_gradient"
class="mb-5 mt-8 btn btn_gradient"
@click="shield"
>Shield PAS to Incognitee
</NuxtLink>

>
<div>{{ txStatus }}</div>
</div>
</template>

<template v-else>
You don’t have enough Paseo PAS on your account. Copy your address
<span style="word-break: break-word; overflow-wrap: break-word;">
<code>{{accountStore.getAddress}}</code>
</span>
and follow the link below to obtain some PAS for free from the
Paseo faucet.

Expand Down Expand Up @@ -57,8 +58,10 @@
<script setup lang="ts">
import { useAccount } from "@/store/account.ts";
import { useIncognitee } from "@/store/incognitee.ts";
import { onMounted, ref, watch } from "vue";
import { ApiPromise, WsProvider } from "@polkadot/api";
import { ref } from "vue";
import { Keyring } from "@polkadot/keyring";
import { hexToU8a } from "@polkadot/util";
const existential_deposit = 10000000000;
const txStatus = ref("");
Expand Down
54 changes: 26 additions & 28 deletions components/Index/Rules.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,32 @@
<div class="column column_medium partner__column">
<h2 class="title title_h2 partner__title">Rules</h2>

<ul
class="paragraph paragraph_medium margin_large partner__description list-disc list-outside"
>
<li>Every shielding event will give you 1 Point</li>
<li>Every unshield event will give you 2 Points</li>
<li>
Perform step 5 to be considered as a participant and get
additional 5 points
</li>
<li>
Don’t post multiple times with the same X account. However,
sending us a message over simpleX and posting on nostr will give
you additional 5 points each
</li>
<li>
You can perform steps 2-4 repeatedly until you run out of funds
</li>
<li>
This campaign aims to test the limits of incognitee by generating
substantial traffic. Should the chain reach its limit and maybe
even become inoperable at any point, the campaign will conclude.
Winners will then be determined based on the data available up to
that moment.
</li>
<li>The top 3 participants will win a prize.</li>
</ul>

<li>Every shielding event will give you 1 Point</li>
<li>Every unshield event will give you 2 Points</li>
<li>
Perform step 5 to be considered as a participant and get additional
5 points
</li>
<li>
Don’t post multiple times with the same X account. However, sending
us a message over simpleX and posting on nostr will give you
additional 5 points each
</li>
<li>
You can perform steps 2-4 repeatedly until you run out of funds
</li>
<li>
This campaign aims to test the limits of incognitee by generating
substantial traffic. Should the chain reach its limit and maybe even
become inoperable at any point, the campaign will conclude. Winners
will then be determined based on the data available up to that
moment.
</li>
<li>The top 3 participants will win a prize.</li>
<li>
Winners will be announced latest 2 weeks after the event via X
</li>
<div class="mt-10"></div>
<h2 class="title title_h2 partner__title">Info</h2>
<li>
Your invites to other people are invisible even to us, but you'll
Expand Down Expand Up @@ -62,7 +61,6 @@
or contact us via Discord
</li>
</div>

<div class="partner__image-wrapper">
<!-- <img src="/img/index/partner/polygons.svg" class="partner__image" alt="Polygons" /> -->
<img
Expand Down
49 changes: 25 additions & 24 deletions components/InviteFriendTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<div class="text-lg">
By clicking the ”Invite Friend” button, you perform a private
transfer of 30% of your available PAS from your Incognitee wallet to
transfer of 10% of your available PAS from your Incognitee wallet to
another wallet with an invite link. You can share this with your
friends and let them participate.
</div>
Expand All @@ -20,7 +20,17 @@
<UButton class="btn btn_gradient" @click="inviteFriend"
>Invite Friend</UButton
>
<div>{{ topStatus }}</div>
<div class="mt-4">{{ topStatus }}</div>
<template v-if="inviteUrl">
<div class="mt-10 mb-3">
<p class="text-sm text-green-700">
{{inviteUrl}}
</p>
</div>
<div class="flex space-x-4 mt-10">
<a class="btn btn_gradient" @click="copyToClipboard">Copy Link</a>
</div>
</template>
</template>
<template
v-if="accountStore.incogniteeBalance <= min_incognitee_balance"
Expand All @@ -45,19 +55,7 @@
</template>
</div>

<div class="mt-10 mb-3">
<input
ref="urlToShareWithFriend"
type="text"
class="dynamic-width border-2 border-gray-200 p-2"
style="color: black"
:value="inviteUrl"
readonly
/>
</div>
<div class="flex space-x-4 mt-10">
<a class="btn btn_gradient" @click="copyToClipboard">Copy</a>
</div>

</div>
</div>
</div>
Expand All @@ -79,7 +77,7 @@ const incogniteeStore = useIncognitee();
const topStatus = ref("");
const inviteUrl = ref(
'click "invite friend" to generate a new wallet for them',
'',
);
const min_incognitee_balance = 0.02 * 10 ** 10;
Expand All @@ -99,7 +97,7 @@ const copyToClipboard = () => {
const inviteFriend = () => {
console.log("creating wallet for your friend");
topStatus.value =
"⌛ sending 30% of your funds to a fresh wallet for your friend. you should see your incognitee balance decrease. make sure to copy the url below and share it with your friend";
"⌛ sending 10% of your funds to a fresh wallet for your friend. you should see your incognitee balance decrease. make sure to copy the url below and share it with your friend";
const generatedMnemonic = mnemonicGenerate();
const localKeyring = new Keyring({ type: "sr25519", ss58Format: 42 });
const newAccount = localKeyring.addFromMnemonic(generatedMnemonic, {
Expand All @@ -118,15 +116,13 @@ const inviteFriend = () => {
"/?seed=" +
privateKeyHex;
console.log("sending 30% of your funds to your friend's account");
console.log("sending 10% of your funds to your friend's account");
const balance = accountStore.incogniteeBalance;
// todo! instead of sending 30% we should check fees explicitly and handle edge cases
const amount = Math.floor(0.3 * balance);
// todo! instead of sending 10% we should check fees explicitly and handle edge cases
const amount = Math.floor(0.1 * balance);
const signer = accountStore.account;
console.log(
`sending ${formatBalance(amount)} from ${signer.address} privately to ${
newAccount.address
}`,
`sending ${formatBalance(amount)} from ${signer.address} privately to ${newAccount.address}`,
);
incogniteeStore.api
.trustedBalanceTransfer(
Expand All @@ -140,7 +136,7 @@ const inviteFriend = () => {
.then((hash) => {
console.log(`trustedOperationHash: ${hash}`);
topStatus.value =
"😀 Success: sent 30% of your funds to a fresh wallet for your friend. you should see your incognitee balance decrease. Please copy the url below and share it with your friend. It's all they need";
"😀 Success: sent 10% of your funds to a fresh wallet for your friend. you should see your incognitee balance decrease. Please copy the url below and share it with your friend. It's all they need";
});
};
</script>
Expand Down Expand Up @@ -169,4 +165,9 @@ const inviteFriend = () => {
border-color: #24ad7c;
height: 55px;
}
.text-sm.text-green-700 {
word-wrap: break-word;
overflow-wrap: break-word;
}
</style>
84 changes: 49 additions & 35 deletions components/PublishonxTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,45 @@
<div class="text-4xl mt-10 mb-10">Tell the World - or Stay Anon</div>
<div class="text-lg">
<div v-if="accountStore.incogniteeBalance == 0">
<i
><b
>You have no balance on Incognitee. Please go back to step 2
to collect more points</b
></i
>
<div class="border-l-4 border-yellow-400 bg-yellow-50 p-4">
<div class="flex">
<div class="flex-shrink-0">
<ExclamationTriangleIcon
class="h-5 w-5 text-yellow-400"
aria-hidden="true"
/>
</div>
<div class="ml-3">
<p class="text-sm text-yellow-700">
You have no balance on Incognitee. Please go back to step 2
to collect more points
{{ " " }}
</p>
</div>
</div>
</div>
</div>
<div v-if="accountStore.paseoBalance == 0">
<i
><b
>You have no balance on Paseo. Please go back to step 2 to
collect more points</b
></i
>
<div v-else-if="accountStore.paseoBalance == 0">
<div class="border-l-4 border-yellow-400 bg-yellow-50 p-4">
<div class="flex">
<div class="flex-shrink-0">
<ExclamationTriangleIcon
class="h-5 w-5 text-yellow-400"
aria-hidden="true"
/>
</div>
<div class="ml-3">
<p class="text-sm text-yellow-700">
You have no balance on Paseo. Please go back to step 2 to
collect more points
{{ " " }}
</p>
</div>
</div>
</div>
</div>
</div>
<div class="text-lg">
<div class="text-lg mt-4">
To be eligible for our prices, please either tweet or send us a
message over SimpleX. Tell the world about your successful test
using the button below. Make sure to include hashtag #incognitee and
Expand Down Expand Up @@ -55,11 +77,11 @@
>post a note on nostr
</NuxtLink>
<div class="mt-5">
<textarea readonly class="template-textarea">
I have successfully tested #incognitee private token transfers on https://try.incognitee.io by @integritee with my account {{
<p class="text-sm text-green-700">
I have successfully tested #incognitee private token transfers on https://try.incognitee.io by @integritee with my account {{
accountStore.getAddress
}}</textarea
>
}}
</p>
</div>
</template>
<template v-else>
Expand All @@ -82,12 +104,11 @@ I have successfully tested #incognitee private token transfers on https://try.in
>send us a simpleX message
</NuxtLink>
<div class="mt-5">
<textarea readonly class="template-textarea">
Dear Integritee team. I have participated in the incognitee beta campaign with account {{
<p class="text-sm text-green-700">
Dear Integritee team. I have participated in the incognitee beta campaign with account {{
accountStore.getAddress
}}
</textarea
>
</p>
</div>
</template>
<template v-else>
Expand All @@ -109,6 +130,7 @@ Dear Integritee team. I have participated in the incognitee beta campaign with a
<script setup lang="ts">
import { ref, onMounted, watch } from "vue";
import { useAccount } from "@/store/account.ts";
import {ExclamationTriangleIcon} from "@heroicons/vue/20/solid";
const accountStore = useAccount();
Expand Down Expand Up @@ -138,18 +160,10 @@ watch(accountStore, updateLinks);
onMounted(updateLinks);
</script>
<style scoped>
.template-textarea {
width: 100%;
height: 80px;
padding: 10px;
border-left: 10px solid #ccc;
border-top: none;
border-right: none;
border-bottom: none;
background-color: transparent;
font-style: italic;
font-size: 1em;
line-height: 1.6;
resize: none;
.text-sm.text-green-700 {
word-wrap: break-word;
overflow-wrap: break-word;
}
</style>
31 changes: 17 additions & 14 deletions components/UnshieldTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<div class="container">
<div class="grid gap-4">
<div class="text-4xl mt-10">Unshield</div>
<div class="mt-4">
By clicking the ”Unshield” button, you perform a transfer of 30%
of your Incognitee balance to your wallet on Paseo.
</div>
<div class="text-lg">
<div
v-if="accountStore.incogniteeBalance < existential_deposit * 4"
Expand All @@ -18,23 +22,22 @@
</div>
<div class="ml-3">
<p class="text-sm text-yellow-700">
Your balance on Incognitee is getting low. Please go back
Your balance on Incognitee is too low. Please go back
to step 2 to top up
{{ " " }}
</p>
</div>
</div>
</div>
</div>
<div class="mt-4">
By clicking the ”Unshield” button, you perform a transfer of 30%
of your Incognitee balance to your wallet on Paseo.
</div>
<div>
<UButton class="mt-10 btn btn_gradient" @click="unshieldFunds"
>Unshield Funds</UButton
>
<div>{{ topStatus }}</div>
<div v-else>
<div>
<UButton class="mt-10 btn btn_gradient" @click="unshieldFunds"
>Unshield Funds
</UButton
>
<div class="mt-4">{{ topStatus }}</div>
</div>
</div>
</div>
</div>
Expand All @@ -44,11 +47,11 @@
</template>

<script setup lang="ts">
import { formatBalance } from "@polkadot/util";
import {formatBalance} from "@polkadot/util";
import { useAccount } from "@/store/account.ts";
import { useIncognitee } from "@/store/incognitee.ts";
import { ref } from "vue";
import {useAccount} from "@/store/account.ts";
import {useIncognitee} from "@/store/incognitee.ts";
import {ref} from "vue";
const accountStore = useAccount();
const incogniteeStore = useIncognitee();
Expand Down
Loading

0 comments on commit 4180405

Please sign in to comment.