lemmy-ui/src/client/index.tsx
SleeplessOne1917 643c1f6f01
Make confirm popup for adult consent (#2419)
* Make confirm popup for adult consent

* Fix import

* Fix blur and adjust user settings

* Make confirmation popup more stylish

* Add setting to site settings form

* Fix modal bug

* Put adult consent logic all in one place

* Make modal use markdown

* Fix consent modal showing up for currently logged in admin

* Add go-back redirect countdown

* Center modal title

* Handle enable_nsfw correctly

* Blur background of modal to hide spicy things

* Add translations
2024-04-18 19:54:16 -04:00

43 lines
1.1 KiB
TypeScript

import { initializeSite } from "@utils/app";
import { hydrate } from "inferno-hydrate";
import { BrowserRouter } from "inferno-router";
import App from "../shared/components/app/app";
import { lazyHighlightjs } from "../shared/lazy-highlightjs";
import { loadUserLanguage } from "../shared/services/I18NextService";
import { verifyDynamicImports } from "../shared/dynamic-imports";
import "bootstrap/js/dist/collapse";
import "bootstrap/js/dist/dropdown";
import "bootstrap/js/dist/modal";
async function startClient() {
// Allows to test imports from the browser console.
window.checkLazyScripts = () => {
verifyDynamicImports(true).then(x => console.log(x));
};
window.history.scrollRestoration = "manual";
initializeSite(window.isoData.site_res);
lazyHighlightjs.enableLazyLoading();
await loadUserLanguage();
const wrapper = (
<BrowserRouter>
<App />
</BrowserRouter>
);
const root = document.getElementById("root");
if (root) {
hydrate(wrapper, root);
root.dispatchEvent(new CustomEvent("lemmy-hydrated", { bubbles: true }));
}
}
startClient();