Fix prettier + eslint
This commit is contained in:
parent
0fe927fd33
commit
793954b0aa
5 changed files with 15 additions and 13 deletions
|
@ -19,8 +19,7 @@ export function Filter({ locale, t, setIndex, surahs }: Props) {
|
||||||
} else {
|
} else {
|
||||||
const regexp = new RegExp(value, "i");
|
const regexp = new RegExp(value, "i");
|
||||||
const newIndex = surahs.filter(
|
const newIndex = surahs.filter(
|
||||||
surah =>
|
surah => regexp.test(surah.name) || regexp.test(String(surah.id)),
|
||||||
regexp.test(surah.name) || regexp.test(String(surah.id)),
|
|
||||||
);
|
);
|
||||||
setIndex(newIndex);
|
setIndex(newIndex);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,12 @@ import postman, { item } from "postman";
|
||||||
item.css("/css/main/surah-stream.css"),
|
item.css("/css/main/surah-stream.css"),
|
||||||
item.font("Kanit Regular", "url(/fonts/kanit-regular.ttf)"),
|
item.font("Kanit Regular", "url(/fonts/kanit-regular.ttf)"),
|
||||||
item.font("Mada Regular", "url(/fonts/mada-regular.ttf"),
|
item.font("Mada Regular", "url(/fonts/mada-regular.ttf"),
|
||||||
item.json(`/json/${locale}/${surahId}/info.json`, { className: "json surahinfo" }),
|
item.json(`/json/${locale}/${surahId}/info.json`, {
|
||||||
item.json(`/json/${locale}/${surahId}/surah.json`, { className: "json surah" }),
|
className: "json surahinfo",
|
||||||
|
}),
|
||||||
|
item.json(`/json/${locale}/${surahId}/surah.json`, {
|
||||||
|
className: "json surah",
|
||||||
|
}),
|
||||||
item.progress((percent: number) => {
|
item.progress((percent: number) => {
|
||||||
progressBar.value = percent;
|
progressBar.value = percent;
|
||||||
progressNumber.innerText = `${percent.toFixed(0)}%`;
|
progressNumber.innerText = `${percent.toFixed(0)}%`;
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import { Quran, TLocale } from "Quran";
|
import { Quran, TLocale } from "Quran";
|
||||||
(function () {
|
(function () {
|
||||||
const defaultl = "en";
|
const defaultl = "en";
|
||||||
const locale = navigator.languages
|
const locale =
|
||||||
|
navigator.languages
|
||||||
.map(s => s.slice(0, 2).toLowerCase())
|
.map(s => s.slice(0, 2).toLowerCase())
|
||||||
.find(s => Quran.locales.includes(s as TLocale)) || defaultl;
|
.find(s => Quran.locales.includes(s as TLocale)) || defaultl;
|
||||||
location.replace(`/${locale}/`);
|
location.replace(`/${locale}/`);
|
||||||
|
|
|
@ -10,9 +10,7 @@ import { SurahIndex } from "~/components/SurahIndex";
|
||||||
const appVersion = root.getAttribute("data-app-version") as string;
|
const appVersion = root.getAttribute("data-app-version") as string;
|
||||||
const t = T(require("@json/t.json"));
|
const t = T(require("@json/t.json"));
|
||||||
const byLocale = require("@json/surahs");
|
const byLocale = require("@json/surahs");
|
||||||
const surahs: Surah[] = byLocale[locale].map(
|
const surahs: Surah[] = byLocale[locale].map((e: TSurah) => new Surah(e));
|
||||||
(e: TSurah) => new Surah(e),
|
|
||||||
);
|
|
||||||
ReactDOM.createRoot(root).render(
|
ReactDOM.createRoot(root).render(
|
||||||
<SurahIndex
|
<SurahIndex
|
||||||
appVersion={appVersion}
|
appVersion={appVersion}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Surah, Ayah, TAyat, TSurah, TLocale } from "Quran";
|
import { Surah, Ayah, TSurah, TLocale } from "Quran";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import ReactDOM from "react-dom/client";
|
import ReactDOM from "react-dom/client";
|
||||||
import { T } from "~/lib/t";
|
import { T } from "~/lib/t";
|
||||||
|
@ -16,8 +16,8 @@ import { SurahStream } from "~/components/SurahStream";
|
||||||
const node2: HTMLScriptElement = document.querySelector(".json.surah")!;
|
const node2: HTMLScriptElement = document.querySelector(".json.surah")!;
|
||||||
const node3: HTMLScriptElement = document.querySelector(".json.durations")!;
|
const node3: HTMLScriptElement = document.querySelector(".json.durations")!;
|
||||||
const blob1: TSurah = JSON.parse(node1.innerText)!;
|
const blob1: TSurah = JSON.parse(node1.innerText)!;
|
||||||
const blob2: [number, string][] = JSON.parse(node2.innerText)!;
|
const blob2: Array<[number, string]> = JSON.parse(node2.innerText)!;
|
||||||
const blob3: [number, number][] = JSON.parse(node3.innerText)!;
|
const blob3: Array<[number, number]> = JSON.parse(node3.innerText)!;
|
||||||
const surah = new Surah(blob1);
|
const surah = new Surah(blob1);
|
||||||
for (let i = 0; i < blob2.length; i++) {
|
for (let i = 0; i < blob2.length; i++) {
|
||||||
const [id, body] = blob2[i] as [number, string];
|
const [id, body] = blob2[i] as [number, string];
|
||||||
|
|
Loading…
Reference in a new issue