improvements to ux, toggle for prod

enumerate
lza_menace 2 years ago
parent 8f058ead66
commit ab9b4adc7f

@ -4,7 +4,7 @@
"version": "0.0.0", "version": "0.0.0",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "DEV=1 vite",
"build": "vite build", "build": "vite build",
"preview": "vite preview" "preview": "vite preview"
}, },

@ -17,15 +17,17 @@
<br /> <br />
Use it to vault your NFTs en masse or to distribute tokens to a large audience for some major gas savings. Use it to vault your NFTs en masse or to distribute tokens to a large audience for some major gas savings.
<br /> <br />
The higher the network gas price, the more savings you will see.
<br />
<br /> <br />
Made by <a href="https://twitter.com/lza_menace" target="_blank" rel="noreferrer">lza_menace</a> of the <a href="https://art101.io" target="_blank" rel="noreferrer">Art101</a> team. Made by <a href="https://twitter.com/lza_menace" target="_blank" rel="noreferrer">lza_menace</a> of the <a href="https://art101.io" target="_blank" rel="noreferrer">Art101</a> team.
<br />
<a href="https://etherscan.io/address/0x76Ae5B6E75F6e05BcaD1028F78A83f974fc96A8B/" target="_blank" rel="noreferrer"> <a href="https://etherscan.io/address/0x76Ae5B6E75F6e05BcaD1028F78A83f974fc96A8B/" target="_blank" rel="noreferrer">
Contract. Etherscan.
</a> </a>
<a href="https://github.com/lalanza808/shipit-app" rel="noreferrer" target="_blank"> <a href="https://github.com/lalanza808/shipit-app" rel="noreferrer" target="_blank">
App. Github (app).
</a>
<a href="https://github.com/lalanza808/shipit" rel="noreferrer" target="_blank">
Github (contract).
</a> </a>
</p> </p>
<Providers /> <Providers />

@ -1,5 +1,5 @@
<script> <script>
import { writable } from 'svelte/store'; // import { CONTRACT } from '$env/dynamic/private';
import { tweened } from 'svelte/motion'; import { tweened } from 'svelte/motion';
import { cubicOut } from 'svelte/easing'; import { cubicOut } from 'svelte/easing';
import { defaultEvmStores as evm, selectedAccount, contracts, web3 } from 'svelte-web3'; import { defaultEvmStores as evm, selectedAccount, contracts, web3 } from 'svelte-web3';
@ -11,7 +11,12 @@
duration: 800, duration: 800,
easing: cubicOut easing: cubicOut
}); });
const shipit = '0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0'; let shipit = '';
if (import.meta.env.DEV) {
shipit = '0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0';
} else {
shipit = '0x76Ae5B6E75F6e05BcaD1028F78A83f974fc96A8B';
}
let errorMessage = ''; let errorMessage = '';
let successMessage = ''; let successMessage = '';
let contractAddress = ''; let contractAddress = '';
@ -52,6 +57,8 @@
await $contracts.nft.methods.setApprovalForAll(shipit, true).send({from: $selectedAccount}); await $contracts.nft.methods.setApprovalForAll(shipit, true).send({from: $selectedAccount});
contractApproved = true; contractApproved = true;
approvalRequired = false; approvalRequired = false;
approvalPending = false;
clearMessages();
} catch(e) { } catch(e) {
errorMessage = `Failed to approve contract: ${e.message}`; errorMessage = `Failed to approve contract: ${e.message}`;
approvalPending = false; approvalPending = false;
@ -66,6 +73,7 @@
contractApproved = false; contractApproved = false;
approvalRequired = false; approvalRequired = false;
revokeRequired = false; revokeRequired = false;
revokePending = false;
clearMessages(); clearMessages();
} catch(e) { } catch(e) {
errorMessage = `Failed to revoke contract: ${e.message}`; errorMessage = `Failed to revoke contract: ${e.message}`;
@ -239,6 +247,7 @@
if (res.status) { if (res.status) {
document.getElementById('recipientInfo').value = ''; document.getElementById('recipientInfo').value = '';
clearMessages(); clearMessages();
transferPending = false;
successMessage = `Success! tx ${res.transactionHash}`; successMessage = `Success! tx ${res.transactionHash}`;
window.scrollTo(0, document.body.scrollHeight); window.scrollTo(0, document.body.scrollHeight);
} else { } else {

Loading…
Cancel
Save