PageSourceSearch

https://iotrader.io/assets/Referral-D41i-M_c.js

js iotrader.io collected 2026-10-07 02:29:29 UTC 6,301 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-trading-D1p3lq87.js";import{r}from"./vendor-icons-6ckh54d_.js";import{L as v}from"./Layout-CUsvgNIy.js";import{P as R}from"./PageSEO-D5QLkR79.js";import{I as k}from"./Icon-DjBwmRGQ.js";import{D as L,W as C}from"./home2-CFGPzgUz.js";import{P as n,q as S,s as E,v as P,w as O,t as U}from"./App-DuU1U4az.js";import{L as u}from"./vendor-react-DQUjuWkt.js";import"./vendor-firebase-BholX5ft.js";import"./OrderlyConnect-D8NMU3_e.js";import"./vendor-web3-BzpTdpCw.js";import"./SiteHeader-BuEhw28K.js";const V=()=>{const{isConnected:a,address:t}=L(),[b,i]=r.useState(!1),[c,d]=r.useState(null),[s,x]=r.useState(""),[j,m]=r.useState(0),[y,p]=r.useState(!1),[f,h]=r.useState(!1);r.useEffect(()=>{if(!a||!t){d(null),x(""),m(0);return}let l=!1;return(async()=>{h(!0);try{await E(t);const[o,N,w]=await Promise.all([P(t),O(t),U(t)]);l||(d(o),x(N),m(w))}catch(o){console.error("Referral page load error:",o)}finally{l||h(!1)}})(),()=>{l=!0}},[a,t]);const g=()=>{s&&(navigator.clipboard.writeText(s),p(!0),setTimeout(()=>p(!1),2e3))};return e.jsxs(v,{activePage:"earn-referral",children:[e.jsx(R,{}),e.jsx("div",{className:"min-h-screen pt-6 pb-20 px-4 lg:px-6",children:e.jsxs("div",{className:"max-w-5xl mx-auto",children:[e.jsxs("div",{className:"mb-8 animate-fade-in-up",children:[e.jsx("h1",{className:"text-4xl md:text-5xl font-black text-white mb-2",children:"Referral"}),e.jsx("p",{className:"text-gray-400 text-sm md:text-base",children:"Begin your journey now! Complete tasks to earn."})]}),!a&&e.jsx("div",{className:"mb-6 p-5 rounded-xl border border-yellow-500/20 bg-yellow-500/5 animate-fade-in-up",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-white font-bold",children:"Connect your wallet"}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"Get your unique referral link and start earning points."})]}),e.jsx("button",{type:"button",onClick:()=>i(!0),className:"btn-primary-accent px-6 py-2.5 text-sm shrink-0",children:"Connect Wallet"})]})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-6 animate-fade-in-up",children:[e.jsxs("div",{className:"rounded-xl border border-white/10 bg-[#0a0a0a] p-5",children:[e.jsx("p",{className:"text-gray-400 text-sm mb-1",children:"Total Referrals"}),e.jsx("p",{className:"text-3xl font-black text-white",children:f?"—":c?.totalReferrals??0})]}),e.jsxs("div",{className:"rounded-xl border border-white/10 bg-[#0a0a0a] p-5",children:[e.jsx("p",{className:"text-gray-400 text-sm mb-1",children:"Your Points"}),e.jsx("p",{className:"text-3xl font-black text-[var(--color-accent-primary)]",children:f?"—":j.toLocaleString()})]}),e.jsxs("div",{className:"rounded-xl border border-white/10 bg-[#0a0a0a] p-5",children:[e.jsx("p",{className:"text-gray-400 text-sm mb-1",children:"Referrer Bonus"}),e.jsxs("p",{className:"text-3xl font-black text-white",children:["+",n.REFERRAL_BONUS,e.jsx("span",{className:"text-base font-bold text-gray-400 ml-1",children:"pts / join"})]})]})]}),e.jsxs("div",{className:"rounded-xl border border-white/10 bg-[#0a0a0a] p-6 mb-6 animate-fade-in-up",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"h-10 w-10 rounded-full border border-[var(--color-accent-primary)]/30 bg-[var(--color-accent-primary)]/10 flex items-center justify-center",children:e.jsx(k,{name:"Users",size:18,className:"text-[var(--color-accent-primary)]"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-white",children:"Referral Link"}),e.jsxs("p",{className:"text-gray-400 text-sm",children:["Share your link. When a new wallet connects with"," ",e.jsx("code",{className:"text-white/80",children:"?ref=YOUR_CODE"}),", you both earn points."]})]})]}),a?c?.referralCode?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[e.jsx("input",{type:"text",value:s,readOnly:!0,className:"flex-1 bg-[#050505] border border-white/10 rounded-xl px-4 py-3 text-white text-sm font-mono focus:outline-none focus:border-[var(--color-accent-primary)]"}),e.jsx("button",{type:"button",onClick:g,className:"h-12 rounded-xl bg-[var(--color-accent-primary)] hover:bg-[var(--color-accent-primary-hover)] text-black font-bold px-6 text-sm transition-colors whitespace-nowrap",children:y?"Copied!":"Copy Link"})]}),e.jsxs("p",{className:"text-gray-500 text-xs mt-3",children:["Referee earns ",n.REFERRAL_SIGNUP," pts · Referrer earns"," ",n.REFERRAL_BONUS," pts per qualified join.",!S()&&" Configure Firebase to sync rewards."]})]}):e.jsx("p",{className:"text-gray-400 text-sm",children:"Loading your referral code…"}):e.jsx("p",{className:"text-gray-400 text-sm",children:"Connect wallet to generate your referral link."})]}),e.jsxs("div",{className:"rounded-xl border border-white/10 bg-[#0a0a0a] p-6 animate-fade-in-up",children:[e.jsx("h3",{className:"text-white font-bold mb-3",children:"How it works"}),e.jsxs("ul",{className:"space-y-2 text-gray-400 text-sm",children:[e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-[var(--color-accent-primary)]",children:"1."}),"Copy your referral link and share it with friends."]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-[var(--color-accent-primary)]",children:"2."}),"They open IO Trader with your code and connect their wallet."]}
1),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-[var(--color-accent-primary)]",children:"3."}),"You both earn points automatically when the referral qualifies."]})]}),e.jsxs("div",{className:"mt-5 flex flex-wrap gap-3",children:[e.jsx(u,{to:"/earn/rewards",className:"inline-flex items-center gap-2 rounded-lg border border-white/20 px-4 py-2 text-sm font-semibold text-white hover:border-[var(--color-accent-primary)]/50 transition-colors",children:"Rewards Hub"}),e.jsx(u,{to:"/leaderboard",className:"inline-flex items-center gap-2 rounded-lg border border-white/20 px-4 py-2 text-sm font-semibold text-white hover:border-[var(--color-accent-primary)]/50 transition-colors",children:"View Leaderboard"})]})]})]})}),e.jsx(C,{isOpen:b,onClose:()=>i(!1)})]})};export{V as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.