diff --git a/assets/icons/icon-gift-opened.svg b/assets/icons/icon-gift-opened.svg new file mode 100644 index 00000000..acdd2eb6 --- /dev/null +++ b/assets/icons/icon-gift-opened.svg @@ -0,0 +1 @@ + diff --git a/assets/style/style.css b/assets/style/style.css index b669fb36..4ae39fa5 100644 --- a/assets/style/style.css +++ b/assets/style/style.css @@ -2733,6 +2733,20 @@ a { margin-bottom: 6px; } +.giftIcons svg { + height:16px; + fill:#7A7387; + position:relative; + top:-4px; +} + +.giftIconsClosed svg { + height:16px; + fill:#9621FF; + position:relative; + top:-2px; +} + .textboxTransparency { background-color: rgba(255, 255, 255, 15%); color: #fff; diff --git a/scripts/dashboard/Dashboard.vue b/scripts/dashboard/Dashboard.vue index e5ea8c23..28165402 100644 --- a/scripts/dashboard/Dashboard.vue +++ b/scripts/dashboard/Dashboard.vue @@ -662,17 +662,83 @@ defineExpose({ > - +
+ +
+
+
+ Calculating... +
+
+
+
+
+ + - - Manage - - State - + > Date.now() - 60000 * 3; @@ -377,40 +382,52 @@ export async function renderSavedPromos() { // If this code is allowed to be deleted or not const fCannotDelete = !cCode.fSynced || fNew || nBal > 0; + // Trimmed code + let trimmedCode = + cCode.code.length > 10 + ? cCode.code.slice(0, 7) + '...' + : cCode.code; + // Status calculation (defaults to 'fNew' condition) - let strStatus = 'Confirming...'; + let strStatus = ''; if (!fNew) { if (cCode.fSynced) { - strStatus = nBal > 0 ? 'Unclaimed' : 'Claimed'; + strStatus = + nBal > 0 + ? '' + + pIconGift + + '' + : '' + + pIconGiftOpen + + ''; } else { - strStatus = 'Syncing'; + strStatus = + ''; } } strHTML += ` - ${ - fCannotDelete - ? '' - : '' - } - ${ - cCode.code - } + }" class="wallet-code" style="display: inline !important; color: #e83e8c;">${trimmedCode} ${ fNew || !cCode.fSynced ? '...' : nBal + ' ' + cChainParams.current.TICKER } - ' + : '' + } + ${strStatus} + }" target="_blank" rel="noopener noreferrer">${strStatus} `; } @@ -494,14 +511,20 @@ export async function updatePromoCreationTick(fRecursive = false) { let strState = ''; if (cThread.txid) { // Complete state - strState = 'Confirming...'; + strState = ''; } else if (cThread.end_state) { // Errored state (failed to broadcast, etc) - strState = cThread.end_state; + if (cThread.end_state == 'Errored') { + strState = ``; + } else if (cThread.end_state == 'Done') { + strState = ``; + } else if (cThread.end_state == 'Cancelled') { + strState = ``; + } } else { // Display progress strState = - ' ' + (cThread.thread.progress || 0) + @@ -512,10 +535,12 @@ export async function updatePromoCreationTick(fRecursive = false) { strHTML = ` - - ${cThread.code} + ${cThread.code} ${cThread.amount} ${cChainParams.current.TICKER} - ${strState} + + + ${strState} + ` + strHTML; } @@ -653,14 +678,15 @@ export async function redeemPromoCode(strCode) { // Listen for and report derivation progress promoThread.onmessage = async (evt) => { if (evt.data.type === 'progress') { + doms.domRedeemCodeDiv.style.display = 'flex'; doms.domRedeemCodeProgress.style.display = ''; doms.domRedeemCodeETA.innerHTML = - '

' + - evt.data.res.eta.toFixed(0) + - 's remaining to unwrap...

' + - evt.data.res.progress + - '%'; - doms.domRedeemCodeProgress.value = evt.data.res.progress; + evt.data.res.eta.toFixed(0) + 's remaining to unwrap...'; + doms.domRedeemCodeProgress.style.setProperty( + 'width', + `${evt.data.res.progress}%`, + 'important' + ); } else { // The finished key! promoThread.terminate(); @@ -668,8 +694,8 @@ export async function redeemPromoCode(strCode) { // Pause animations and finish 'unwrapping' by checking the derived Promo Key for a balance doms.domRedeemCodeGiftIcon.classList.remove('fa-bounce'); - doms.domRedeemCodeProgress.style.display = 'none'; - doms.domRedeemCodeETA.innerHTML = '

Final checks...'; + doms.domRedeemCodeDiv.style.display = 'none'; + doms.domRedeemCodeETA.innerHTML = 'Final checks...'; // Prepare the global Promo Wallet cPromoWallet = new PromoWallet({