// app.jsx — page router for the multi-page site. // Each HTML file sets `
`. // We read that, pull the relevant screen from window.*, and render it full-bleed. window.__IS_LIVE_SITE = true; const { useState: _appS, useEffect: _appE, useMemo: _appM } = React; // ──────────────────────────────────────────────────────────── // Shared persistence — tweaks + favs + current listing live in localStorage // so they survive page navigation. // ──────────────────────────────────────────────────────────── const APP_KEYS = { tweaks: 'is:tweaks', favs: 'is:favs', listing: 'is:currentListing', authMode: 'is:authMode', }; function loadJson(key, fallback) { try { const v = localStorage.getItem(key); return v ? JSON.parse(v) : fallback; } catch { return fallback; } } function saveJson(key, v) { try { localStorage.setItem(key, JSON.stringify(v)); } catch {} } // ──────────────────────────────────────────────────────────── // Navigation helpers — real URLs so the site behaves like a site. // ──────────────────────────────────────────────────────────── function goTo(path) { window.location.href = path; } function goToListing(listing) { saveJson(APP_KEYS.listing, listing); window.location.href = 'ilan.html'; } function goToAuth(mode) { saveJson(APP_KEYS.authMode, mode || 'login'); window.location.href = 'giris.html'; } function goToCheckout(listing) { if (listing) saveJson(APP_KEYS.listing, listing); window.location.href = 'odeme.html'; } function goToDashboard() { window.location.href = 'panelim.html'; } function goToHome() { window.location.href = 'index.html'; } Object.assign(window, { goTo, goToListing, goToAuth, goToCheckout, goToDashboard, goToHome }); // ──────────────────────────────────────────────────────────── // TWEAKS defaults — the EDITMODE block is in each HTML shell, but // we also persist user changes to localStorage so they carry over. // ──────────────────────────────────────────────────────────── const DEFAULT_TWEAKS = { lang: 'tr', dark: false, palette: 'sunset', density: 'regular', layout: 'grid', }; // Minimal fallback useTweaks in case tweaks-panel.jsx version isn't enough — // we want localStorage sync across pages regardless of edit-mode. function useAppTweaks(defaults) { const [t, setT] = _appS(() => ({ ...defaults, ...loadJson(APP_KEYS.tweaks, {}) })); const setTweak = (k, v) => { setT(prev => { const next = { ...prev, [k]: v }; saveJson(APP_KEYS.tweaks, next); // also tell the host (in-app tweak panel support) try { window.parent.postMessage({ type: '__edit_mode_set_keys', edits: { [k]: v } }, '*'); } catch {} return next; }); }; return [t, setTweak]; } // ──────────────────────────────────────────────────────────── // Footer — shared across all pages // ──────────────────────────────────────────────────────────── function SiteFooter({ L, lang }) { const year = new Date().getFullYear(); const cols = lang === 'tr' ? [ { h: 'Pazaryeri', links: [['Keşfet', 'index.html'], ['Arama', 'arama.html'], ['Karşılaştır', 'karsilastir.html'], ['İlan Ver', 'ilan-ver.html']] }, { h: 'Hesabım', links: [['Giriş', 'giris.html'], ['Kayıt Ol', 'giris.html'], ['Panelim', 'panelim.html'], ['Hesap Devri', 'devir.html']] }, { h: 'Yardım', links: [['Aged Hesap Nedir?', 'aged-hesap-nedir.html'], ['Hakkında', 'hakkinda.html'], ['SSS', 'aged-hesap-nedir.html#sss']] }, { h: 'Hukuki', links: [['KVKK', 'kvkk.html'], ['Mesafeli Satış', 'mesafeli-satis.html'], ['Ön Bilgilendirme', 'on-bilgilendirme.html'], ['Koşullar', 'kosullar.html']] }, ] : [ { h: 'Marketplace', links: [['Explore', 'index.html'], ['Search', 'arama.html'], ['Compare', 'karsilastir.html'], ['Sell', 'ilan-ver.html']] }, { h: 'Account', links: [['Login', 'giris.html'], ['Sign up', 'giris.html'], ['My Panel', 'panelim.html'], ['Transfer', 'devir.html']] }, { h: 'Help', links: [['What is aged?', 'aged-hesap-nedir.html'], ['About', 'hakkinda.html'], ['FAQ', 'aged-hesap-nedir.html#sss']] }, { h: 'Legal', links: [['GDPR', 'kvkk.html'], ['Distance Sales', 'mesafeli-satis.html'], ['Pre-info', 'on-bilgilendirme.html'], ['Terms', 'kosullar.html']] }, ]; return ( ); } // Mobile bottom nav that actually navigates (for real site pages) function MobileBottomNav({ L, active }) { const items = [ { id: 'home', label: L.nav_explore, icon: 'grid', href: 'index.html' }, { id: 'search', label: lang => lang === 'tr' ? 'Ara' : 'Search', icon: 'search', href: 'arama.html' }, { id: 'fav', label: L.dash_fav, icon: 'heart', href: 'panelim.html' }, { id: 'me', label: lang => lang === 'tr' ? 'Hesap' : 'Account', icon: 'users', href: 'panelim.html' }, ]; return (