Hide <RightArrow> for non-rtl locale

This commit is contained in:
0x1eef 2024-03-25 04:58:51 -03:00
parent 28b0464ddf
commit 71d1029f85

View file

@ -17,6 +17,7 @@ export function SurahIndex({ locale, surahs, t }: Props) {
const [theme, setTheme] = useTheme(); const [theme, setTheme] = useTheme();
const [index, setIndex] = useState<Quran.Surah[]>(surahs); const [index, setIndex] = useState<Quran.Surah[]>(surahs);
const ref = useRef<HTMLDivElement>(); const ref = useRef<HTMLDivElement>();
const ltr = locale === "en";
useEffect(() => { useEffect(() => {
if (ref.current) { if (ref.current) {
@ -63,8 +64,8 @@ export function SurahIndex({ locale, surahs, t }: Props) {
className="flex flex-row items-center no-underline" className="flex flex-row items-center no-underline"
href={`/${locale}/random/`} href={`/${locale}/random/`}
> >
<RightArrow /> {ltr && <RightArrow />}
<span className="pl-3">{t(locale, "ChooseRandomChapter")}</span> <span className={classNames({"pl-3": ltr})}>{t(locale, "ChooseRandomChapter")}</span>
</a> </a>
<SurahIndexFilter <SurahIndexFilter
t={t} t={t}