Closed mohitb35 closed 2 months ago
The latest updates on your projects. Learn more about Vercel for Git βοΈ
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
planet-webapp-multi-tenancy-setup | β Ready (Inspect) | Visit Preview | π¬ Add feedback | Sep 11, 2024 6:44am |
This pull request introduces a CurrencyProvider
to the PlanetWeb
application, enhancing the context management for currency data. The CurrencyProvider
is integrated into the component hierarchy, allowing child components to access currency-related information. Additionally, a new CurrencyContext
is created to manage supported currencies, and existing components are updated to utilize this context. The sortCountriesByTranslation
function is modified to filter countries based on their associated currency codes, improving the application's handling of country and currency relationships.
Files | Change Summary |
---|---|
pages/_app.tsx |
Added CurrencyProvider to the component hierarchy, modifying context structure for child components. |
src/features/common/Layout/CurrencyContext.tsx |
Introduced CurrencyContext and CurrencyProvider , including state management and a custom hook useCurrency . |
src/features/common/Layout/Footer/SelectLanguageAndCountry.tsx |
Incorporated useCurrency to enhance country sorting logic with currency support. |
src/utils/countryCurrency/countryUtils.js |
Modified sortCountriesByTranslation to include a new parameter for supported currency codes and updated filtering logic. |
sequenceDiagram
participant App
participant CurrencyProvider
participant ChildComponent
participant CountryUtils
App->>CurrencyProvider: Initialize
CurrencyProvider->>ChildComponent: Provide currency context
ChildComponent->>CurrencyProvider: Request supported currencies
CurrencyProvider-->>ChildComponent: Return supported currencies
ChildComponent->>CountryUtils: Sort countries with currencies
CountryUtils->>ChildComponent: Return sorted countries
π In a world of coins and notes,
A new provider proudly floats.
With currencies now in sight,
Sorting countries feels just right.
Hops of joy, letβs celebrate,
For every change, we elevate! π
src/utils/countryCurrency/countryUtils.js (1)
`48-69`: **LGTM!** The changes to the `sortCountriesByTranslation` function are approved. The addition of the `supportedCurrencyCodes` parameter and the filtering logic improves the functionality of the function by allowing it to filter countries based on their currency codes.src/features/common/Layout/Footer/SelectLanguageAndCountry.tsx (1)
`97-105`: **LGTM!** The changes to the `MapCountry` function are approved. The addition of the `supportedCurrencies` variable and passing it as an argument to the `sortCountriesByTranslation` function improves the functionality of the component by incorporating currency support into the country sorting logic.pages/_app.tsx (2)
`37-37`: **LGTM!** The import statement for `CurrencyProvider` is correctly added. --- `219-291`: **LGTM!** The `CurrencyProvider` is correctly integrated into the component hierarchy, and its positioning before the `TenantProvider` is appropriate. The rest of the component hierarchy remains unchanged.
This pull request fixes an issue where countries with unsupported currencies were still being displayed in the country selector.