Give cold visitors context on member dashboards
/my/<id> links circulate (address-bar shares, pre-/join links), and a cold prospect landing there saw stats with no story. First-time viewers of a position now get a banner: two-sentence RM Circle summary, a "Read your invitation from this member" CTA into /join/<id>, a strategy link, and the risk line. Hidden for repeat viewers of the same position (likely the member) and dismissible per session. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
+14
-1
@@ -58,6 +58,17 @@
|
||||
});
|
||||
function render(d){
|
||||
prompt.classList.add('hidden');dash.classList.remove('hidden');
|
||||
// cold-visitor context banner: shown unless this looks like the member's own
|
||||
// dashboard (their stored ID matches) or they dismissed it this session
|
||||
try{
|
||||
const intro=document.getElementById('coldIntro');
|
||||
const seenBefore=d._priorId===String(d.id); // they've viewed this position before (likely their own)
|
||||
const dismissed=sessionStorage.getItem('ctb.introDismissed')==='1';
|
||||
if(intro){
|
||||
if(!seenBefore&&!dismissed){intro.classList.remove('hidden');document.getElementById('coldIntroJoin').href='/join/'+d.id;}
|
||||
else intro.classList.add('hidden');
|
||||
}
|
||||
}catch(e){}
|
||||
document.getElementById('dTitle').textContent='#'+d.id;
|
||||
const qb=document.getElementById('dQualified');
|
||||
if(qb)qb.outerHTML=d.directCount>=2
|
||||
@@ -128,7 +139,7 @@
|
||||
const d=await r.json();
|
||||
if(!r.ok)throw new Error(d.error||'Lookup failed');
|
||||
if(!d.registered)throw new Error(`ID ${id} isn't registered on the smart contract — double-check the number.`);
|
||||
try{localStorage.setItem('ctb.myId',String(id))}catch(e){}
|
||||
try{d._priorId=localStorage.getItem('ctb.myId');localStorage.setItem('ctb.myId',String(id))}catch(e){}
|
||||
if(!/^\/my\/\d+$/.test(location.pathname))history.replaceState(null,'','/my/'+id);
|
||||
render(d);
|
||||
}catch(x){
|
||||
@@ -136,6 +147,8 @@
|
||||
document.getElementById('idError').textContent=x.message;
|
||||
}
|
||||
}
|
||||
const introX=document.getElementById('coldIntroClose');
|
||||
if(introX)introX.addEventListener('click',()=>{try{sessionStorage.setItem('ctb.introDismissed','1')}catch(e){};document.getElementById('coldIntro').classList.add('hidden')});
|
||||
document.getElementById('dJoinForm').addEventListener('submit',async e=>{
|
||||
e.preventDefault();
|
||||
const form=e.currentTarget,msg=document.getElementById('dJoinMsg');
|
||||
|
||||
Reference in New Issue
Block a user