From 636a4a7273f8b2dcef52a2d8c68d51162ec99015 Mon Sep 17 00:00:00 2001 From: Rajat Jindal Date: Fri, 11 Oct 2024 14:35:30 +0530 Subject: [PATCH] Fix missing flag issue in "Phone Number" section MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I have fixed the missing flag issue by updating the base path for the flag source and I tested the same thing after updaing, and I made a video for the same and we can check here → https://app.screencast.com/a6nxZYx8p8qbe --- packages/i18nify-playground/src/constants/geo/index.js | 3 +++ .../src/sections/phoneNumber/phoneNumber-form.jsx | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/i18nify-playground/src/constants/geo/index.js b/packages/i18nify-playground/src/constants/geo/index.js index cb2acf6d..d892060e 100644 --- a/packages/i18nify-playground/src/constants/geo/index.js +++ b/packages/i18nify-playground/src/constants/geo/index.js @@ -1 +1,4 @@ export const ALLOWED_COUNTRIES = ['IN', 'MY', 'FR', 'DE', 'US']; + +export const FLAG_4X3_BASE_PATH = + 'https://unpkg.com/@razorpay/i18nify-js/lib/assets/flags'; diff --git a/packages/i18nify-playground/src/sections/phoneNumber/phoneNumber-form.jsx b/packages/i18nify-playground/src/sections/phoneNumber/phoneNumber-form.jsx index 91c2cfae..66cee10d 100644 --- a/packages/i18nify-playground/src/sections/phoneNumber/phoneNumber-form.jsx +++ b/packages/i18nify-playground/src/sections/phoneNumber/phoneNumber-form.jsx @@ -19,6 +19,10 @@ import { localPhoneNumbersByDialCodeMap, } from './data/phoneNumber'; +import { + FLAG_4X3_BASE_PATH +} from '../../constants/geo'; + const PhoneNumberForm = ({ inpValue, onInpChange, @@ -88,7 +92,7 @@ const PhoneNumberForm = ({ marginRight: 8, }} loading="lazy" - src={`/assets/flags/${dialCodeCountryCodeMap[ + src={`${FLAG_4X3_BASE_PATH}/${dialCodeCountryCodeMap[ code ][0].toLocaleLowerCase()}.svg`} />