// App shell — tgplay topbar + couple sidebar + mobile tab bar // Changes from the design prototype: // - Removed non-functional "search games" input (no backend search yet) // - "tgplay" brand links to the portal domain instead of resetting state // - "new" badge on Reveal entry uses the real game state from the API const NAV = [ { id: 'today', label: 'Сегодня', icon: 'today' }, { id: 'reveal', label: 'Раскрытие', icon: 'reveal' }, { id: 'archive', label: 'Архив', icon: 'archive' }, { id: 'stats', label: 'Статистика', icon: 'stats' }, { id: 'capsule', label: 'Наша капсула', icon: 'capsule' }, { id: 'settings', label: 'Настройки', icon: 'settings' } ]; const PORTAL_URL = 'https://tgplay.ru'; window.TopBar = function TopBar({ screen, state, data }) { const screenLabel = ({ today: 'Сегодня', reveal: 'Раскрытие', archive: 'Архив', stats: 'Статистика', capsule: 'Наша капсула', settings: 'Настройки', onboarding: 'Подключение', landing: 'Превью' })[screen] || screen; const showCrumb = !!data && data.hasPair && screen !== 'landing' && screen !== 'onboarding'; const meInitial = data && data.me ? data.me.initial : '?'; const meName = data && data.me ? data.me.name : ''; return (
tg tgplay
Вопрос дня для пары {showCrumb && <> {screenLabel} }
{meName && (
{meInitial} {meName}
)}
); }; window.Sidebar = function Sidebar({ screen, setScreen, state, data }) { const hasReveal = state === 'reveal-ready'; const newCount = hasReveal ? 1 : 0; const me = data && data.me; const partner = data && data.partner; const pair = data && data.pair; return ( ); }; window.MobileTabs = function MobileTabs({ screen, setScreen, state }) { const hasReveal = state === 'reveal-ready'; const items = [ { id: 'today', label: 'Сегодня', icon: 'today' }, { id: 'reveal', label: 'Раскрыть', icon: 'reveal', badge: hasReveal }, { id: 'archive', label: 'Архив', icon: 'archive' }, { id: 'stats', label: 'Статы', icon: 'stats' }, { id: 'settings', label: 'Ещё', icon: 'settings' } ]; return ( ); };