// Wrapping screens — phone frame with the grid at each density const { IOSDevice } = window; const { TABLES } = window; const { Card1x1, Card2x1, Card2x2, Card4x1, Card4x2 } = window.TableCards; const { DesignCanvas, DCSection, DCArtboard } = window; // Density specs — each one has a column count, gap, and a card renderer. // "1x1" means 4 columns of tiny squares; "4x2" means 1 large card per row. // // The naming reflects relative density: 1x1 = highest density (smallest cards), // 4x2 = lowest density (biggest, most info). const DENSITIES = { '1x1': { label: '1×1 — Highest density', desc: 'Just the name. Status as color.', cols: 4, gap: 8, aspectW: 1, aspectH: 1, Card: Card1x1, }, '2x1': { label: '2×1 — Compact', desc: 'Name + status pill.', cols: 2, gap: 10, aspectW: 2, aspectH: 1, Card: Card2x1, }, '2x2': { label: '2×2 — Balanced', desc: 'Name, status, amount, waiters.', cols: 2, gap: 12, aspectW: 1, aspectH: 1, Card: Card2x2, }, '4x1': { label: '4×1 — Wide row', desc: 'Name, amount, status, waiters.', cols: 1, gap: 10, aspectW: 4, aspectH: 1, Card: Card4x1, }, '4x2': { label: '4×2 — Full detail', desc: 'Everything. Section, badges, waiter names.', cols: 1, gap: 12, aspectW: 2, aspectH: 1, Card: Card4x2, }, }; // Top filter bar function FilterBar() { const filters = [ { label: 'All', active: true }, { label: 'Mine' }, { label: 'Free' }, { label: 'Zone (2)' }, ]; return (
{filters.map(f => ( ))}
); } function Header({ density }) { return (
Tables
dimitris
); } function DensityScreen({ densityKey }) { const d = DENSITIES[densityKey]; // Compute card width: phone interior is ~370px wide, padding 12px each side const padding = 12; const innerW = 370 - padding * 2; const cardW = (innerW - d.gap * (d.cols - 1)) / d.cols; const cardH = cardW * (d.aspectH / d.aspectW); return (
{TABLES.map(t => ( ))}
); } function App() { const order = ['1x1', '2x1', '2x2', '4x1', '4x2']; return ( {order.map(k => { const d = DENSITIES[k]; return (
); })}
); } const root = ReactDOM.createRoot(document.getElementById('root')); root.render();