From 8ff89334c662bb37bdff112b693a0f72d7194017 Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja <1805317@kiit.ac.in> Date: Wed, 13 Mar 2024 16:58:39 +0530 Subject: [PATCH] feat: added prop for PaymentHeader Text (#226) --- src/LocaleString.res | 18 ------------------ src/PaymentElement.res | 14 ++++++++++---- src/Payments/CardPayment.res | 4 ++-- src/Types/PaymentType.res | 6 ++++++ 4 files changed, 18 insertions(+), 24 deletions(-) diff --git a/src/LocaleString.res b/src/LocaleString.res index 26de81dfc..25eaab7d5 100644 --- a/src/LocaleString.res +++ b/src/LocaleString.res @@ -65,8 +65,6 @@ type localeStrings = { saveWalletDetails: string, morePaymentMethods: string, useExistingPaymentMethods: string, - selectPaymentMethodLabel: string, - savedPaymentMethodsLabel: string, nicknameLabel: string, nicknamePlaceholder: string, } @@ -149,8 +147,6 @@ let defaultLocale = { saveWalletDetails: "Wallets details will be saved upon selection", morePaymentMethods: "More payment methods", useExistingPaymentMethods: "Use saved payment methods", - selectPaymentMethodLabel: "Select Payment Method", - savedPaymentMethodsLabel: "Saved Payment Methods", nicknameLabel: "Card Nickname", nicknamePlaceholder: "Card Nickname (Optional)", } @@ -235,8 +231,6 @@ let localeStrings = [ saveWalletDetails: "Wallets details will be saved upon selection", morePaymentMethods: "More payment methods", useExistingPaymentMethods: "Use saved payment methods", - selectPaymentMethodLabel: "Select Payment Method", - savedPaymentMethodsLabel: "Saved Payment Methods", nicknameLabel: "Card Nickname", nicknamePlaceholder: "Card Nickname (Optional)", }, @@ -318,8 +312,6 @@ let localeStrings = [ saveWalletDetails: "פרטי הארנק יישמרו בעת בחירה", morePaymentMethods: `אמצעי תשלום נוספים`, useExistingPaymentMethods: `השתמש באמצעי תשלום שמורים`, - selectPaymentMethodLabel: `בחר שיטת תשלום`, - savedPaymentMethodsLabel: `אמצעי תשלום שמורים`, nicknameLabel: `כינוי לכרטיס`, nicknamePlaceholder: `כינוי לכרטיס (אופציונלי)`, }, @@ -401,8 +393,6 @@ let localeStrings = [ saveWalletDetails: "Les détails du portefeuille seront enregistrés lors de la sélection", morePaymentMethods: `Plus de méthodes de paiement`, useExistingPaymentMethods: `Utiliser les modes de paiement enregistrés`, - selectPaymentMethodLabel: `Sélectionnez le mode de paiement`, - savedPaymentMethodsLabel: `Modes de paiement enregistrés`, nicknameLabel: `Pseudonyme de la carte`, nicknamePlaceholder: `Surnom de la carte (facultatif)`, }, @@ -484,8 +474,6 @@ let localeStrings = [ saveWalletDetails: "Wallets details will be saved upon selection", morePaymentMethods: "More payment methods", useExistingPaymentMethods: "Use saved payment methods", - selectPaymentMethodLabel: "Select Payment Method", - savedPaymentMethodsLabel: "Saved Payment Methods", nicknameLabel: "Card Nickname", nicknamePlaceholder: "Card Nickname (Optional)", }, @@ -567,8 +555,6 @@ let localeStrings = [ saveWalletDetails: "سيتم حفظ تفاصيل المحفظة عند الاختيار", morePaymentMethods: `المزيد من طرق الدفع`, useExistingPaymentMethods: `استخدم طرق الدفع المحفوظة`, - selectPaymentMethodLabel: `اختار طريقة الدفع`, - savedPaymentMethodsLabel: `طرق الدفع المحفوظة`, nicknameLabel: `الاسم علي الكارت`, nicknamePlaceholder: `اسم البطاقة (اختياري)`, }, @@ -650,8 +636,6 @@ let localeStrings = [ saveWalletDetails: "選択時にウォレットの詳細が保存されます", morePaymentMethods: `その他の支払い方法`, useExistingPaymentMethods: `保存した支払い方法を使用する`, - selectPaymentMethodLabel: `支払い方法を選択してください`, - savedPaymentMethodsLabel: `保存された支払い方法`, nicknameLabel: `カードのニックネーム`, nicknamePlaceholder: `カードニックネーム(任意)`, }, @@ -733,8 +717,6 @@ let localeStrings = [ saveWalletDetails: "Wallet-Details werden beim Auswählen gespeichert", morePaymentMethods: `Mehr Zahlungsmethoden`, useExistingPaymentMethods: `Gespeicherte Zahlungsarten nutzen`, - selectPaymentMethodLabel: `Wählen Sie die Zahlungsmethode`, - savedPaymentMethodsLabel: `Gespeicherte Zahlungsarten`, nicknameLabel: `Spitzname der Karte`, nicknamePlaceholder: `Kartenname (optional)`, }, diff --git a/src/PaymentElement.res b/src/PaymentElement.res index 11547b33a..26ff92ed9 100644 --- a/src/PaymentElement.res +++ b/src/PaymentElement.res @@ -14,7 +14,6 @@ let make = ( ~countryProps, ~paymentType: CardThemeType.mode, ) => { - let {localeString} = Recoil.useRecoilValueFromAtom(RecoilAtoms.configAtom) let sessionsObj = Recoil.useRecoilValueFromAtom(sessions) let { showCardFormByDefault, @@ -23,6 +22,7 @@ let make = ( customerPaymentMethods, displaySavedPaymentMethods, } = Recoil.useRecoilValueFromAtom(optionAtom) + let optionAtomValue = Recoil.useRecoilValueFromAtom(optionAtom) let isApplePayReady = Recoil.useRecoilValueFromAtom(isApplePayReady) let isGooglePayReady = Recoil.useRecoilValueFromAtom(isGooglePayReady) let methodslist = Recoil.useRecoilValueFromAtom(list) @@ -396,13 +396,19 @@ let make = ( }, [displaySavedPaymentMethods]) let paymentLabel = if displaySavedPaymentMethods { - showFields ? localeString.selectPaymentMethodLabel : localeString.savedPaymentMethodsLabel + showFields + ? optionAtomValue.paymentMethodsHeaderText + : optionAtomValue.savedPaymentMethodsHeaderText } else { - localeString.selectPaymentMethodLabel + optionAtomValue.paymentMethodsHeaderText } <> -