renderer.tsx
1 import { createRoot } from 'react-dom/client'; 2 import { App } from './App'; 3 import './globals.css'; 4 5 // Apply dark mode at the HTML level so body/scrollbars also get dark variables 6 document.documentElement.classList.add('dark'); 7 8 // ─── Native UI: disable web-like behaviors ───────────────────── 9 window.addEventListener('contextmenu', (e) => e.preventDefault()); 10 document.addEventListener('dragover', (e) => e.preventDefault()); 11 document.addEventListener('drop', (e) => e.preventDefault()); 12 13 if (window.electronAPI.isPackaged) { 14 window.addEventListener('keydown', (e) => { 15 if (!(e.ctrlKey || e.metaKey)) return; 16 if (e.key === 'r' || e.key === 'u' || e.key === 'p') { 17 e.preventDefault(); 18 } 19 }); 20 } 21 22 const container = document.getElementById('root'); 23 if (!container) throw new Error('No #root element found'); 24 25 createRoot(container).render(<App />);