From 1e61b2adf913c5c648757e486c84fed063ca50c4 Mon Sep 17 00:00:00 2001 From: iqbalpa Date: Sat, 20 Jul 2024 08:36:54 +0700 Subject: [PATCH] fix: overflow in detail page --- src/app/[id]/layout.tsx | 6 ++--- src/app/layout.tsx | 4 ++-- src/modules/detailSurah/detailSurah.tsx | 30 ++++++++++++------------- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/src/app/[id]/layout.tsx b/src/app/[id]/layout.tsx index ae96d82..af41863 100644 --- a/src/app/[id]/layout.tsx +++ b/src/app/[id]/layout.tsx @@ -6,10 +6,8 @@ export default function DetailLayout({ children: React.ReactNode; }>) { return ( -
- - {children} - +
+ {children}
); } diff --git a/src/app/layout.tsx b/src/app/layout.tsx index f72cefe..6d8001e 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -26,8 +26,8 @@ export default function RootLayout({ >
-
{children}
- +
{children}
+
diff --git a/src/modules/detailSurah/detailSurah.tsx b/src/modules/detailSurah/detailSurah.tsx index b27a01b..6268543 100644 --- a/src/modules/detailSurah/detailSurah.tsx +++ b/src/modules/detailSurah/detailSurah.tsx @@ -1,6 +1,7 @@ 'use client'; import { getSurahByNomor } from '@/api/api'; +import { ScrollArea } from '@/components/ui/scroll-area'; import { DetailSurah } from '@/constant/surah.constant'; import { Play } from 'lucide-react'; import { usePathname } from 'next/navigation'; @@ -25,24 +26,23 @@ const DetailSurahPage: React.FC = () => { }, [pathname]); if (!surah) { - return; + return null; } return ( -
-

- {surah.namaLatin} - {surah.nama} -

-

- {surah.jumlahAyat} ayat - {surah.arti} - {surah.tempatTurun} -

-
+
+
+

+ {surah.namaLatin} - {surah.nama} +

+

+ {surah.jumlahAyat} ayat - {surah.arti} - {surah.tempatTurun} +

+
+ {surah.ayat.map((ayat, _index) => ( -
-
+
+

{surah.nomor}:{ayat.nomorAyat} @@ -69,7 +69,7 @@ const DetailSurahPage: React.FC = () => {


))} -
+
); };