This commit is contained in:
0x1eef 2024-10-18 03:39:23 -03:00
parent e802d6ef19
commit fd4eb1e409
4 changed files with 45 additions and 43 deletions

View file

@ -1,12 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<title></title>
<title>The Noble Quran</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<script src="/js/index.js"></script>
</head>
<body>
<div class="app mount root h-full"></div>
<script src="/js/index.js"></script>
</body>
</html>

View file

@ -15,6 +15,11 @@ export function LanguageSelect({
setActiveLocale,
}: Props) {
const locales = Object.values(Quran.locales);
if (!activeLocale) {
return null;
}
return (
<Select
value={activeLocale.name}

View file

@ -52,7 +52,7 @@ export function SurahIndex({ locale, surahs, t }: Props) {
<LanguageSelect
isOpen={showLangDropdown}
setIsOpen={setShowLangDropdown}
locale={activeLocale}
activeLocale={activeLocale}
setActiveLocale={setActiveLocale}
/>
<ThemeSelect

View file

@ -9,7 +9,7 @@ import classNames from "classnames";
import { Router } from "preact-router";
import "core-js";
const exports = {
const globals = {
Quran,
React,
render,
@ -19,10 +19,9 @@ const exports = {
useRef,
classNames,
};
Object.assign(window, exports);
Object.assign(window, globals);
document.addEventListener("DOMContentLoaded", () => {
const Main = (function () {
const Main = (function () {
const t = T(require("@json/t.json"));
return () => {
return (
@ -55,7 +54,5 @@ document.addEventListener("DOMContentLoaded", () => {
</Router>
);
};
})();
render(<Main />, document.querySelector(".mount"));
});
})();
render(<Main />, document.querySelector(".mount"));