cd52a2f82f
Browser-based photo catalog with an optional team server (SQLite + LibRaw). Local database, uploaded photos, build output and dependencies are gitignored. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
25 lines
850 B
TypeScript
25 lines
850 B
TypeScript
import { createRoot } from 'react-dom/client';
|
|
import App from './App';
|
|
import ProofingGallery from './components/ProofingGallery';
|
|
import JoinPage from './components/JoinPage';
|
|
import './styles.css';
|
|
|
|
const root = document.getElementById('root');
|
|
if (!root) throw new Error('root element missing');
|
|
|
|
// Proofing links are public: /g/<token> renders the gallery straight away and
|
|
// never mounts the editor or asks for a session.
|
|
const galleryMatch = /^\/g\/([A-Za-z0-9_-]+)\/?$/.exec(window.location.pathname);
|
|
// Invite links are public too: the token decides whether signup is allowed.
|
|
const joinMatch = /^\/join\/([A-Za-z0-9_-]+)\/?$/.exec(window.location.pathname);
|
|
|
|
createRoot(root).render(
|
|
galleryMatch ? (
|
|
<ProofingGallery token={galleryMatch[1]} />
|
|
) : joinMatch ? (
|
|
<JoinPage token={joinMatch[1]} />
|
|
) : (
|
|
<App />
|
|
),
|
|
);
|