/* ───────────────────────────────────────────────── Configurator — pick body × pick tab bar ───────────────────────────────────────────────── */ /* The "01" home is the canonical HomeScreen + RoseTabBar. Wrap it so it can accept a custom tab bar via render prop, matching the V02..V21 contract. */ function HomeV01({ customTabBar }) { const [tab, setTab] = React.useState("home"); const noop = ()=>{}; return (
{tab==="home" && setTab(s)} openClass={noop} openNews={noop} openCourse={noop}/>} {tab==="classes" && } {tab==="online" && } {tab==="profile" && }
{customTabBar ? customTabBar({ active: tab, onChange: setTab }) : }
); } /* All home variants in one ordered array. Each entry: render fn that accepts { customTabBar } so the configurator can override the bar. The V02..V21 variants don't accept a prop directly — we wrap them in TabBarOverride to inject via context. */ const HOME_VARIANTS = [ { n:"01", name:"исходный", Render: ({customTabBar}) => }, { n:"02", name:"список", Render: ({customTabBar}) => }, { n:"03", name:"журнал", Render: ({customTabBar}) => }, { n:"04", name:"брутал", Render: ({customTabBar}) => }, { n:"05", name:"подушки", Render: ({customTabBar}) => }, { n:"06", name:"неон", Render: ({customTabBar}) => }, { n:"07", name:"истории", Render: ({customTabBar}) => }, { n:"08", name:"бенто", Render: ({customTabBar}) => }, { n:"09", name:"таймлайн", Render: ({customTabBar}) => }, { n:"10", name:"орбита", Render: ({customTabBar}) => }, { n:"11", name:"спа", Render: ({customTabBar}) => }, { n:"12", name:"плитки", Render: ({customTabBar}) => }, { n:"13", name:"автомат", Render: ({customTabBar}) => }, { n:"14", name:"ленты", Render: ({customTabBar}) => }, { n:"15", name:"типо", Render: ({customTabBar}) => }, { n:"16", name:"стикербук", Render: ({customTabBar}) => }, { n:"17", name:"таблица", Render: ({customTabBar}) => }, { n:"18", name:"герой", Render: ({customTabBar}) => }, { n:"19", name:"плакат", Render: ({customTabBar}) => }, { n:"20", name:"привычки", Render: ({customTabBar}) => }, { n:"21", name:"учителя", Render: ({customTabBar}) => }, ]; function Configurator() { const [bodyN, setBodyN] = React.useState("01"); const [tabN, setTabN] = React.useState("01"); const body = HOME_VARIANTS.find(v=>v.n===bodyN); const tab = TAB_VARIANTS.find(v=>v.n===tabN); const TabBarComp = tab.Comp; const customTabBar = ({active,onChange}) => ; return (
{/* Body picker */}
тело · 21 вариант
{HOME_VARIANTS.map(v=>{ const a = v.n===bodyN; return ( ); })}
выбрано тело · {body.n}
{body.name}
{/* Tab bar picker */}
таб-бар · 20 вариантов
{TAB_VARIANTS.map(v=>{ const a = v.n===tabN; return ( ); })}
выбран таб-бар · {tab.n}
{tab.name}
{tab.desc}
{/* Live phone */}
); } Object.assign(window, { Configurator, HOME_VARIANTS });