/* ===== Settings — fully functional, persisted via setProfile / tweaks ===== */ /* ---- Backup helpers: export/import ALL persisted app data ---- */ function exportAppData() { var payload = { app: 'sectionly', version: 2, exportedAt: new Date().toISOString(), data: window.Store.state() }; var blob = new Blob([JSON.stringify(payload, null, 2)], { type: 'application/json' }); var url = URL.createObjectURL(blob); var a = document.createElement('a'); a.href = url; a.download = 'sectionly-backup-' + new Date().toISOString().slice(0, 10) + '.json'; document.body.appendChild(a); a.click(); a.remove(); setTimeout(function () { URL.revokeObjectURL(url); }, 1000); } function importAppData(file, done) { var r = new FileReader(); r.onload = function () { try { var parsed = JSON.parse(String(r.result)); var data = parsed && parsed.data ? parsed.data : parsed; if (!data || typeof data !== 'object') { done(false, 0); return; } window.Store.replaceAll(data); var n = (data.userSections ? data.userSections.length : 0); done(true, n); } catch (e) { done(false, 0); } }; r.readAsText(file); } function Switch({ on, onClick }) { return )}
{tab === 'profile' && } {tab === 'account' && } {tab === 'appearance' && } {tab === 'notifications' && } {tab === 'billing' && } {tab === 'security' && }
); } /* ---------- Profile ---------- */ function ProfileTab({ profile, setProfile, notify }) { const [form, setForm] = useState(profile); const fileRef = useRef(null); const dirty = JSON.stringify(form) !== JSON.stringify(profile); const set = (k, v) => setForm(f => Object.assign({}, f, { [k]: v })); const onPick = (e) => { const file = e.target.files[0]; if (!file) return; if (!/^image\//.test(file.type)) { notify('Please choose an image', true); return; } const r = new FileReader(); r.onload = () => set('avatar', String(r.result)); r.readAsDataURL(file); }; return ( <>

Profile photo

This appears in the sidebar and on your shared sections.

{form.avatar ? {form.name} : initials(form.name)}
{form.avatar && }

Personal information

Update your name and how others see you.

set('name', e.target.value)} />
set('role', e.target.value)} />
set('email', e.target.value)} />
set('company', e.target.value)} />