From 91bed907d7c5a6f9ce3e3110f0167057162d8346 Mon Sep 17 00:00:00 2001 From: Yusuf-YENICERI Date: Mon, 29 Jan 2024 15:11:20 +0300 Subject: [PATCH] =?UTF-8?q?B=C4=B0SM=C4=B0LLAH=C4=B0RRAHMAN=C4=B0RRAH?= =?UTF-8?q?=C4=B0M?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit new khatms were breaking Header part(date) on page problem fixed inshaAllah --- src/backend/APIs/firebase_api/index.js | 5 ++++- src/components/cuz/Cuzler/index.js | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/backend/APIs/firebase_api/index.js b/src/backend/APIs/firebase_api/index.js index 902cd51..9e6b07d 100644 --- a/src/backend/APIs/firebase_api/index.js +++ b/src/backend/APIs/firebase_api/index.js @@ -651,9 +651,12 @@ class FirebaseAPI{ try { let titleResult = await this.db.ref(`hatim/${this.extractKey()}/${subKey}/baslik`).get(); let descriptionResult = await this.db.ref(`hatim/${this.extractKey()}/${subKey}/description`).get(); + let dateResult = await this.db.ref(`hatim/${this.extractKey()}/${subKey}/bitisTarihi`).get(); + return { title: titleResult.val(), - description: descriptionResult.val() + description: descriptionResult.val(), + date: dateResult.val() } } catch (error) { return {data: undefined, error: error} diff --git a/src/components/cuz/Cuzler/index.js b/src/components/cuz/Cuzler/index.js index 78c1331..d830b15 100644 --- a/src/components/cuz/Cuzler/index.js +++ b/src/components/cuz/Cuzler/index.js @@ -158,6 +158,7 @@ const Question = ({ toggle }) => { const [cuzlerHatimCardTitle, setCuzlerHatimCardTitle] = useState("") const [cuzlerHatimCardDescription, setCuzlerHatimCardDescription] = useState("") + const [cuzlerHatimCardDate, setCuzlerHatimCardDate] = useState("") /** CuzlerHatimCard End */ @@ -204,10 +205,11 @@ const Question = ({ toggle }) => { return; } - const {title, description} = await database.getTitleAndDescription({subKey: Object.values(result.khatmSubKeys)[0]}); + const {title, description, date} = await database.getTitleAndDescription({subKey: Object.values(result.khatmSubKeys)[0]}); setCuzlerHatimCardTitle(title) setCuzlerHatimCardDescription(description) + setCuzlerHatimCardDate(date) // console.log(result.khatmSubKeys) setKhatmSubKeys(result.khatmSubKeys); @@ -530,7 +532,7 @@ const Question = ({ toggle }) => { { hatim.subKey == currentKhatmSubKey)[0].bitisTarihi.split("-").reverse().join("/")} + duaLeftDays={cuzlerHatimCardDate.split("-").reverse().join("/")} yesHandler={yesHandlerState} toggleYesHandler={toggleYesHandlerState} noHandler={noHandlerState} toggleNoHandler={toggleNoHandlerState}