Add video

This commit is contained in:
Andras Schmelczer 2026-05-05 22:15:29 +01:00
parent 589de0c5ac
commit 7c36cbfdd4
18 changed files with 2292 additions and 333 deletions

View file

@ -1,6 +1,6 @@
import { createRoot, hydrateRoot } from 'react-dom/client';
import App from './App';
import './i18n';
import { INITIAL_LANGUAGE, i18nReady } from './i18n';
import './index.css';
import './hooks/usePlausible';
@ -8,9 +8,21 @@ const container = document.getElementById('root');
if (!container) {
throw new Error('Root element not found');
}
const root = container;
if (container.children.length > 0) {
hydrateRoot(container, <App />);
} else {
createRoot(container).render(<App />);
function renderApp() {
const hasPrerenderedMarkup = root.children.length > 0;
if (hasPrerenderedMarkup && INITIAL_LANGUAGE === 'en') {
hydrateRoot(root, <App />);
return;
}
if (hasPrerenderedMarkup) {
root.textContent = '';
}
createRoot(root).render(<App />);
}
void i18nReady.then(renderApp);