/* Notices, Sector Maps, Support, Profile */
(function () {
const { useState } = React;
const Icon = window.Icon, PageHead = window.PageHead, SectorMap = window.SectorMap, Avatar = window.Avatar;
const D = window.YEIDA;
/* ---------------- NOTICES ---------------- */
const NCATS = ['All', 'Policy Update', 'Construction Guidelines', 'Sector Update', 'Authority Circular', 'Announcement'];
function Notices() {
const [cat, setCat] = useState('All');
const [sel, setSel] = useState(D.notices[0]);
const list = D.notices.filter(n => cat === 'All' || n.cat === cat);
return (
{NCATS.map(c => setCat(c)}>{c} )}
{list.map(n => (
setSel(n)} className="card card-hover" style={{ textAlign: 'left', padding: '16px 18px', cursor: 'pointer', border: sel.id === n.id ? '1.5px solid var(--blue-400)' : '1px solid var(--line)', background: sel.id === n.id ? 'var(--blue-50)' : '#fff' }}>
{n.cat}
{n.pinned && }
{n.title}
{n.date}{n.attachments.length > 0 && ' · ' + n.attachments.length + ' attachment' + (n.attachments.length > 1 ? 's' : '')}
))}
{sel.title}
{sel.date} YEIDA Authority
{sel.body}
{sel.attachments.length > 0 && (
Attachments
{sel.attachments.map(a => (
{a}
Download
))}
)}
);
}
/* ---------------- SECTOR MAPS ---------------- */
function SectorMaps({ go }) {
const [active, setActive] = useState(D.sectors[0]);
return (
{D.sectors.map(s => (
setActive(s)} className={'chip' + (active.id === s.id ? ' active' : '')} style={{ flex: 'none' }}>
{s.mine && }{s.name}
))}
{active.name} {active.mine && Your sector }
{[['Type', active.type], ['Total Plots', active.plots.toLocaleString('en-IN')], ['Status', active.status], ['Location', 'Yamuna Expressway']].map(([l, v]) => (
{l} {v}
))}
Map Layers
{[['Road Network', 'map'], ['Infrastructure', 'building'], ['Master Plan Overlay', 'grid'], ['Satellite View', 'layers']].map(([l, ic]) => (
{l}
))}
Master Plan PDF
Download the official {active.name} master plan.
go('documents')}> Download
);
}
/* ---------------- SUPPORT ---------------- */
function Support() {
return (
New Ticket
{[['Live Chat', 'Avg. response 2 min', 'chat', 'emerald'], ['Call Request', 'Request a callback', 'phone', 'blue'], ['Email Support', 'support@yeida.gov.in', 'mail', 'navy']].map(([t, s, ic, c]) => {
const cc = { emerald: ['var(--emerald-50)', 'var(--emerald-700)'], blue: ['var(--blue-50)', 'var(--blue-600)'], navy: ['#e9eefb', 'var(--navy-700)'] }[c];
return (
);
})}
My Tickets
Ticket Subject Priority Status Updated
{D.tickets.map(t => (
{t.id}
{t.subject}
{t.priority}
{t.status}
{t.updated}
))}
Frequently Asked
{['How do I generate an e-Challan?', 'What is the construction approval timeline?', 'How is transfer fee calculated?', 'How do I update my KYC?', 'Where can I find my lease deed?'].map(q => (
{q}
))}
);
}
/* ---------------- PROFILE ---------------- */
function Profile({ go }) {
const [tab, setTab] = useState('personal');
const tabs = [['personal', 'Personal Info', 'user'], ['kyc', 'KYC Verification', 'shield'], ['security', 'Security', 'lock'], ['notifications', 'Notifications', 'bell'], ['devices', 'Devices', 'device']];
return (
{D.user.name} Allottee · {D.user.allotment}
KYC Verified
Member since {D.user.memberSince}
{tabs.map(([k, l, ic]) => (
setTab(k)} className="row gap-3" style={{ width: '100%', padding: '11px 13px', borderRadius: 10, border: 'none', background: tab === k ? 'var(--blue-50)' : 'transparent', color: tab === k ? 'var(--blue-600)' : 'var(--ink-2)', fontWeight: tab === k ? 700 : 500, fontSize: 14, cursor: 'pointer', textAlign: 'left' }}>
{l}
))}
{tab === 'personal' &&
}
{tab === 'kyc' &&
}
{tab === 'security' &&
}
{tab === 'notifications' &&
}
{tab === 'devices' &&
}
);
}
function PersonalTab() {
const f = [['Full Name', D.user.name, 'user'], ['Mobile Number', D.user.mobile, 'phone'], ['Email Address', D.user.email, 'mail'], ['Allotment Number', D.user.allotment, 'building'], ['Sector', D.user.sector, 'map'], ['Plot Number', D.user.plot, 'plot']];
return (
Personal Information Edit
{f.map(([l, v, ic]) => (
))}
);
}
function KycTab() {
return (
KYC Verification
Your KYC is fully verified
Verified on 12 Mar 2019 · Aadhaar & PAN linked
{[['Aadhaar', 'xxxx xxxx 4821', true], ['PAN', 'ABCDE****F', true], ['Address Proof', 'Verified', true]].map(([l, v, ok]) => (
))}
);
}
function SecurityTab() {
return (
Security Settings
{[['Password', 'Last changed 3 months ago', 'Change'], ['Two-Factor Authentication', 'OTP via mobile enabled', 'Manage'], ['Login Alerts', 'Email on new device login', 'Configure']].map(([l, s, b]) => (
))}
);
}
function NotifTab() {
const items = [['Payment reminders', true], ['Construction approval updates', true], ['New notices & circulars', true], ['Transfer status', false], ['Promotional updates', false]];
return (
Notification Preferences
{items.map(([l, on], i) => )}
);
}
function Toggle({ label, on }) {
const [v, setV] = useState(on);
return (
{label}
setV(!v)} style={{ width: 46, height: 26, borderRadius: 99, border: 'none', cursor: 'pointer', background: v ? 'var(--emerald-500)' : '#cdd7e4', position: 'relative', transition: 'background .2s' }}>
);
}
function DevicesTab() {
const dev = [['MacBook Pro · Chrome', 'Greater Noida · Active now', true], ['iPhone 14 · YEIDA App', 'Greater Noida · 2h ago', false], ['Windows PC · Edge', 'Delhi · 5 days ago', false]];
return (
Connected Devices
{dev.map(([l, s, cur], i) => (
{cur ?
This device :
Sign out }
))}
);
}
Object.assign(window, { Notices, SectorMaps, Support, Profile });
})();