diff --git a/src/js/components/Select/LanguageSelect.tsx b/src/js/components/Select/LanguageSelect.tsx index ff817f1..197bcc8 100644 --- a/src/js/components/Select/LanguageSelect.tsx +++ b/src/js/components/Select/LanguageSelect.tsx @@ -17,6 +17,7 @@ export function LanguageSelect({ locale }: Props) { key={i} className={classNames( "flex h-6 w-full justify-center no-underline mb-1 rounded border-accent", + l.direction === "rtl" ? "font-cairo" : "font-kanit", l.direction, l.name === locale.name ? "active" : undefined, )} diff --git a/src/js/loaders/SurahIndexLoader.ts b/src/js/loaders/SurahIndexLoader.ts index b160014..375c380 100644 --- a/src/js/loaders/SurahIndexLoader.ts +++ b/src/js/loaders/SurahIndexLoader.ts @@ -11,14 +11,14 @@ import { formatNumber } from "~/lib/t"; .querySelector("meta[name='revision']")! .getAttribute("content")!; const fonts = (() => { + const f = [ + item.font("Cairo Regular", "url(/fonts/cairo-regular.ttf)"), + item.font("Kanit Regular", "url(/fonts/kanit-regular.ttf)"), + ]; if (doc.dir === "rtl") { - return [ - item.font("Cairo Regular", "url(/fonts/cairo-regular.ttf)"), - item.font("Cairo Bold", "url(/fonts/cairo-bold.ttf)"), - ]; - } else { - return [item.font("Kanit Regular", "url(/fonts/kanit-regular.ttf)")]; + f.push(item.font("Cairo Bold", "url(/fonts/cairo-bold.ttf)")); } + return f; })(); postman( diff --git a/src/js/loaders/SurahStreamLoader.ts b/src/js/loaders/SurahStreamLoader.ts index 6c008fa..1957acb 100644 --- a/src/js/loaders/SurahStreamLoader.ts +++ b/src/js/loaders/SurahStreamLoader.ts @@ -12,15 +12,15 @@ import { formatNumber } from "~/lib/t"; .querySelector("meta[name='revision']")! .getAttribute("content")!; const fonts = (() => { + const f = [ + item.font("Cairo Regular", "url(/fonts/cairo-regular.ttf)"), + item.font("Kanit Regular", "url(/fonts/kanit-regular.ttf)"), + ]; if (doc.dir === "rtl") { - return [ - item.font("Cairo Regular", "url(/fonts/cairo-regular.ttf)"), - item.font("Cairo Bold", "url(/fonts/cairo-bold.ttf)"), - item.font("Amiri Regular", "url(/fonts/amiri-regular.ttf)"), - ]; - } else { - return [item.font("Kanit Regular", "url(/fonts/kanit-regular.ttf)")]; + f.push(item.font("Cairo Bold", "url(/fonts/cairo-bold.ttf)")); + f.push(item.font("Amiri Regular", "url(/fonts/amiri-regular.ttf)")); } + return f; })(); postman(