From 0ecaab0b080f0b3d94aeeaef67723f85445f6b42 Mon Sep 17 00:00:00 2001 From: Reza_ashrafi Date: Wed, 11 May 2022 14:56:45 +0430 Subject: [PATCH] fixed .? --- src/screens/QRContent/Content/Links.js | 2 +- src/screens/QRContent/Content/PDF.js | 4 ++-- src/screens/QRContent/Content/Video.js | 4 ++-- src/screens/QRContent/Content/Voice.js | 4 ++-- src/screens/QRContent/Content/index.js | 16 +++++++------- src/screens/QRContent/Tab/index.js | 30 +++++++++++++------------- src/screens/QRContent/index.js | 2 +- src/screens/ShoppingCart/index.js | 10 ++++----- 8 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/screens/QRContent/Content/Links.js b/src/screens/QRContent/Content/Links.js index cf0e91a..c2b15d7 100644 --- a/src/screens/QRContent/Content/Links.js +++ b/src/screens/QRContent/Content/Links.js @@ -29,7 +29,7 @@ export default function Links({ links }) { > لینک ها - {links.map((link, i) => ( + {links?.map((link, i) => ( {link} diff --git a/src/screens/QRContent/Content/PDF.js b/src/screens/QRContent/Content/PDF.js index 99dfd56..27156fb 100644 --- a/src/screens/QRContent/Content/PDF.js +++ b/src/screens/QRContent/Content/PDF.js @@ -19,7 +19,7 @@ export default function PDF({ data }) { "w-full flex-row-reverse justify-between items-center rounded-md bg-red-100 py-3 px-2 mt-5" )} onPress={() => - OpenAnything.Pdf(`https://dnvn.ir/api/v1/file/${data.fileIds}`) + OpenAnything.Pdf(`https://dnvn.ir/api/v1/file/${data?.fileIds}`) } > - {data.name} + {data?.name} diff --git a/src/screens/QRContent/Content/Video.js b/src/screens/QRContent/Content/Video.js index 3d31956..9fb2f59 100644 --- a/src/screens/QRContent/Content/Video.js +++ b/src/screens/QRContent/Content/Video.js @@ -25,14 +25,14 @@ export default function VideoContent({ data, theme }) { }, ]} > - {"موضوع:" + " " + data.name} + {"موضوع:" + " " + data?.name} ); } diff --git a/src/screens/QRContent/Content/index.js b/src/screens/QRContent/Content/index.js index 8cdcf8b..a06e3db 100644 --- a/src/screens/QRContent/Content/index.js +++ b/src/screens/QRContent/Content/index.js @@ -32,7 +32,7 @@ export default function Content({ data, grades, theme }) { textAlign: "right", }} > - {data.book.name} + {data?.book?.name} - {"پایه" + " " + grades[data.book.gradeId]} + {"پایه" + " " + grades[data?.book?.gradeId]} {`شما در حال مشاهده صفحه ${data.qr.pageNumber} هستید.`} + >{`شما در حال مشاهده صفحه ${data?.qr?.pageNumber} هستید.`} obj.type === "voice")[0], - video: data.qr.content.filter((obj) => obj.type === "video")[0], - pdf: data.qr.content.filter((obj) => obj.type === "pdf")[0], - ppt: data.qr.content.filter((obj) => obj.type === "ppt")[0], - links: data.qr.content.filter((obj) => obj.type === "links")[0], + voice: data?.qr?.content?.filter((obj) => obj?.type === "voice")[0], + video: data?.qr?.content?.filter((obj) => obj?.type === "video")[0], + pdf: data?.qr?.content?.filter((obj) => obj?.type === "pdf")[0], + ppt: data?.qr?.content?.filter((obj) => obj?.type === "ppt")[0], + links: data?.qr?.content?.filter((obj) => obj?.type === "links")[0], }} theme={theme} /> diff --git a/src/screens/QRContent/Tab/index.js b/src/screens/QRContent/Tab/index.js index 00dbdc3..47e92ad 100644 --- a/src/screens/QRContent/Tab/index.js +++ b/src/screens/QRContent/Tab/index.js @@ -227,17 +227,17 @@ function Tab({ data, theme }) { {dataType === "all" ? ( <> - {data.voice ? : null} - {data.video ?