From 9e9caa79f8d0de418601857b97a0f1cb31f09df1 Mon Sep 17 00:00:00 2001 From: Akbar Date: Fri, 26 Apr 2024 15:09:24 +0500 Subject: [PATCH 1/2] code fixed --- .../ReadArea/components/AyahsArea/AyahsArea.jsx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/pages/Main/components/Quran/ReadArea/components/AyahsArea/AyahsArea.jsx b/src/pages/Main/components/Quran/ReadArea/components/AyahsArea/AyahsArea.jsx index fec1588..83d27b4 100644 --- a/src/pages/Main/components/Quran/ReadArea/components/AyahsArea/AyahsArea.jsx +++ b/src/pages/Main/components/Quran/ReadArea/components/AyahsArea/AyahsArea.jsx @@ -8,7 +8,10 @@ import { deviceIsPhone } from '../../../../../../../js/utils/device' import './AyahsArea.css' export default function AyahsArea({ arAyahs, engAyahs, surahI, setSurahI }) { - const progress = progressPercent(surahI.ayah, arAyahs?.length) + const ayahsLen = arAyahs?.length || 0 + const { ayah } = surahI + + const progress = progressPercent(ayah, arAyahs?.length) const isPhone = deviceIsPhone() return ( @@ -16,10 +19,10 @@ export default function AyahsArea({ arAyahs, engAyahs, surahI, setSurahI }) {
- +
- {surahI.ayah}/{arAyahs?.length || 0} + {ayah}/{ayahsLen}
{ceil(progress) || 0}%
@@ -28,13 +31,13 @@ export default function AyahsArea({ arAyahs, engAyahs, surahI, setSurahI }) { )}
- {surahI.ayah < (arAyahs?.length || 0) && ( + {ayah < ayahsLen && (
-

{arAyahs[surahI.ayah]?.text}

+

{arAyahs[ayah]?.text}

-

{engAyahs[surahI.ayah]?.text}

+

{engAyahs[ayah]?.text}

)} From 2e419759bffc31a4d3c9c05e06279f06129fe66d Mon Sep 17 00:00:00 2001 From: Akbar Date: Fri, 26 Apr 2024 15:11:30 +0500 Subject: [PATCH 2/2] show how much ahays left --- .../Quran/ReadArea/components/AyahsArea/AyahsArea.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/Main/components/Quran/ReadArea/components/AyahsArea/AyahsArea.jsx b/src/pages/Main/components/Quran/ReadArea/components/AyahsArea/AyahsArea.jsx index 83d27b4..59e3036 100644 --- a/src/pages/Main/components/Quran/ReadArea/components/AyahsArea/AyahsArea.jsx +++ b/src/pages/Main/components/Quran/ReadArea/components/AyahsArea/AyahsArea.jsx @@ -22,7 +22,8 @@ export default function AyahsArea({ arAyahs, engAyahs, surahI, setSurahI }) {
- {ayah}/{ayahsLen} + {ayah}/{ayahsLen}{' '} + {ayahsLen - ayah} left
{ceil(progress) || 0}%