Branded Voice copy pass, members activity panels, menu update
Site copy regenerated through the bv-tester1 engine; em dashes scrubbed from all user-visible strings. /api/my/activity serves per-member earnings, referrals, and purchases from the chain index. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
+22
-5
@@ -16,15 +16,16 @@
|
||||
$('creditLine').textContent = (me.credits || 0).toLocaleString();
|
||||
const bc = me.buyerCount || 0;
|
||||
$('qualLine').innerHTML = '<b>' + bc + '</b> qualifying buyer(s) referred<br>'
|
||||
+ (bc >= 5 ? '<span class="badge">Level 3 unlocked — full three-level earnings</span>'
|
||||
+ (bc >= 5 ? '<span class="badge">Level 3 unlocked: full three-level earnings</span>'
|
||||
: bc >= 2 ? '<span class="badge">Level 2 unlocked</span> · ' + (5 - bc) + ' more for level 3'
|
||||
: (2 - bc) + ' more ≥$20 buyer(s) unlock level 2');
|
||||
$('activateCard').hidden = true;
|
||||
$('inviteLine').textContent = location.origin + '/join/' + me.memberId;
|
||||
$('copyInvite').hidden = false;
|
||||
loadActivity();
|
||||
} else {
|
||||
$('posLine').innerHTML = 'Signed in as <span class="mono">' + me.address.slice(0, 8) + '…' + me.address.slice(-6)
|
||||
+ '</span><br>free member — not on-chain yet'
|
||||
+ '</span><br>free member, not on-chain yet'
|
||||
+ (me.sponsorId ? '<br>invited by member #' + me.sponsorId : '');
|
||||
$('creditLine').textContent = '0';
|
||||
$('qualLine').textContent = 'Activate your payout wallet (or buy any package) to start; referrals who buy ≥$20 packages qualify you.';
|
||||
@@ -34,6 +35,22 @@
|
||||
}
|
||||
}
|
||||
|
||||
async function loadActivity() {
|
||||
try {
|
||||
const c = await IAP.getConfig();
|
||||
const a = await (await fetch('/api/my/activity')).json();
|
||||
const fill = (id, evs, empty) => {
|
||||
const el = $(id);
|
||||
el.innerHTML = '';
|
||||
if (!evs.length) { el.innerHTML = '<div class="row muted">' + empty + '</div>'; return; }
|
||||
for (const ev of evs) el.appendChild(IAP.feedRow(ev, c));
|
||||
};
|
||||
fill('earnFeed', a.earnings, 'No payouts yet. They appear here the moment one lands.');
|
||||
fill('refFeed', a.referrals, 'No referral activity yet. Share your invite link.');
|
||||
fill('buyFeed', a.purchases, 'No purchases from this wallet yet.');
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
$('signinBtn').addEventListener('click', async () => {
|
||||
try {
|
||||
$('signinBtn').disabled = true;
|
||||
@@ -51,8 +68,8 @@
|
||||
const me = await (await fetch('/api/me')).json();
|
||||
IAP.status('Confirm the free activation in your wallet…');
|
||||
const r = await IAPWallet.activate(me.sponsorId || 0);
|
||||
if (r.receipt.status !== '0x1') throw new Error('Transaction reverted — see the explorer.');
|
||||
IAP.status('Payout wallet activated — your invite link is live.', 'ok');
|
||||
if (r.receipt.status !== '0x1') throw new Error('Transaction reverted. Check the explorer.');
|
||||
IAP.status('Payout wallet activated. Your invite link is live.', 'ok');
|
||||
await render();
|
||||
} catch (e) { IAP.status('Activation failed: ' + ((e && e.message) || e), 'bad'); }
|
||||
finally { $('activateBtn').disabled = false; }
|
||||
@@ -60,7 +77,7 @@
|
||||
|
||||
$('copyInvite').addEventListener('click', async () => {
|
||||
try { await navigator.clipboard.writeText($('inviteLine').textContent); IAP.status('Link copied.', 'ok'); }
|
||||
catch (e) { IAP.status('Copy failed — select and copy the link text.', 'bad'); }
|
||||
catch (e) { IAP.status('Copy failed. Select and copy the link text.', 'bad'); }
|
||||
});
|
||||
|
||||
render();
|
||||
|
||||
Reference in New Issue
Block a user