Dashboard 'My Next Step' panel + funded badge
Adds a synthesized next-step panel to /my: the level ladder (you-are-here → upgrade-next), the single clearest action (qualify vs upgrade), and a funded badge that checks the member's wallet against their next upgrade cost. Privacy: the wallet balance is checked server-side (chain.balanceOf via eth_getBalance) and ONLY a funded true/false is returned — the raw balance is never exposed on the ID-addressable dashboard. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -99,6 +99,7 @@
|
||||
document.getElementById('dIncome').innerHTML=inc.length
|
||||
?`<div class="table-wrap"><table class="table" style="min-width:520px"><thead><tr><th>When</th><th>From member</th><th>For</th><th>Amount</th></tr></thead><tbody>${inc.map(p=>`<tr><td>${date(p.ts)}</td><td>#${p.fromId}</td><td>${esc(p.desc)}</td><td><strong>${fmt(p.pol)} POL</strong></td></tr>`).join('')}</tbody></table></div>`
|
||||
:'<div class="empty">No payments yet — they appear here the moment they land on-chain.</div>';
|
||||
renderNextStep(d);
|
||||
renderPipeline(d);
|
||||
renderAlerts(d);
|
||||
renderShare(d);
|
||||
@@ -113,6 +114,33 @@
|
||||
}catch(e){return ''}
|
||||
}
|
||||
const LEVELS=['Scintilla','Ascensus','Fabrica','Culmen','Apex','Fastigium','Vertex','Corona'];
|
||||
// "My Next Step" — the single clearest action + the level ladder + a funded
|
||||
// badge (server tells us funded true/false; it never sends the raw balance).
|
||||
function renderNextStep(d){
|
||||
const el=document.getElementById('dNextStep');if(!el)return;
|
||||
const ns=d.nextStep||{},lvl=d.level||1;
|
||||
const ladder=LEVELS.map((nm,i)=>{
|
||||
const L=i+1;let cls='nlv';
|
||||
if(L<lvl)cls+=' done';else if(L===lvl)cls+=' you';else if(ns.kind==='upgrade'&&L===ns.nextLevel)cls+=' next';
|
||||
const tag=L===lvl?'<span class="nlvt">YOU</span>':(ns.kind==='upgrade'&&L===ns.nextLevel?'<span class="nlvt">NEXT</span>':'');
|
||||
return `<div class="${cls}">${tag}<span class="nlvn">${nm}</span></div>`;
|
||||
}).join('');
|
||||
let head='',body='',badge='';
|
||||
if(ns.kind==='qualify'){
|
||||
head='Your next step — get qualified';
|
||||
body=`You need <strong>${ns.need} more direct${ns.need===1?'':'s'}</strong> (people who join on <em>your</em> link) to unlock upgrade payments. Grab your link from <a href="#dShare" style="color:var(--teal)">Share this position</a> below and go get them.`;
|
||||
}else if(ns.kind==='upgrade'){
|
||||
const nm=LEVELS[ns.nextLevel-1]||('Level '+ns.nextLevel);
|
||||
head=`Your next step — upgrade to ${esc(nm)}`;
|
||||
body=`Stay one level ahead of your deepest active team so the pass-ups from below land on <em>you</em> instead of skipping past. Upgrade with your earned POL when you can.`;
|
||||
if(ns.funded===true)badge='<span class="ns-badge ok">✓ Funded — you can upgrade now</span>';
|
||||
else if(ns.funded===false)badge='<span class="ns-badge no">Keep building — not funded yet</span>';
|
||||
}else if(ns.kind==='max'){
|
||||
head="You're at the top level 🏆";
|
||||
body='Keep helping your team duplicate — every level they climb still pays up to you.';
|
||||
}else{el.innerHTML='';return;}
|
||||
el.innerHTML=`<div class="ns-card"><div class="ns-top"><div class="ns-eyebrow">Your plan</div>${badge}</div><div class="ns-h">${head}</div><p class="ns-p">${body}</p><div class="nladder">${ladder}</div></div>`;
|
||||
}
|
||||
function renderPipeline(d){
|
||||
const el=document.getElementById('dPipeline');
|
||||
if(!el)return;
|
||||
|
||||
Reference in New Issue
Block a user