Rupato/replace growthbook config with firebase #455
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces updates to the account switcher and related components to integrate Firebase-based country configurations (
hubEnabledCountryList
) and streamline residence handling. Key changes include replacing the Growthbook feature flag with Firebase configurations, passing theresidence
property through several components, and updating redirection logic for Trader's Hub and wallets.Integration of Firebase Country Configurations:
useGrowthbookGetFeatureValue
withuseFirebaseCountriesConfig
inAccountSwitcherWalletMobile
,AccountSwitcherWallet
, and other related components to usehubEnabledCountryList
for country-specific configurations. ([[1]](https://github.com/deriv-com/bot/pull/455/files#diff-948b4480a9b3fd95a8a64f3416c7af8d1482e4098d2b2d792adf21416d821bd5L7-R7)
,[[2]](https://github.com/deriv-com/bot/pull/455/files#diff-8093d4ae9559ad56dcce6cf76b37866860279c27066a8dc0d2f2e3769d543d7aR6)
,[[3]](https://github.com/deriv-com/bot/pull/455/files#diff-7431f2f873b7b5cbcd9127a9c3985b9f7f8fa732f8fc2cc0c136d8f7c878fa8cR7-R42)
,[[4]](https://github.com/deriv-com/bot/pull/455/files#diff-fa0242e511a8bc020e881a84c3155a89d3e3153c2477befa969e2eb1ac44d00fR2-R16)
,[[5]](https://github.com/deriv-com/bot/pull/455/files#diff-369c35ed105770696d1e076b245f598bf8b44660ac3fefe85ee26b5f31e5b7c3L7-R7)
)Residence Property Enhancements:
residence
as an optional property to various types and components (TAccountSwitcherWalletMobile
,TAccountSwitcherWalletProps
,TAccountSwitcherFooter
, etc.) to pass user residence information. ([[1]](https://github.com/deriv-com/bot/pull/455/files#diff-948b4480a9b3fd95a8a64f3416c7af8d1482e4098d2b2d792adf21416d821bd5R19-R27)
,[[2]](https://github.com/deriv-com/bot/pull/455/files#diff-8093d4ae9559ad56dcce6cf76b37866860279c27066a8dc0d2f2e3769d543d7aR19-R24)
,[[3]](https://github.com/deriv-com/bot/pull/455/files#diff-174aad40a7c0d25bf564cf3237d9ce412154412b70c1a7e1beabc3e632ff73f0R46)
,[[4]](https://github.com/deriv-com/bot/pull/455/files#diff-174aad40a7c0d25bf564cf3237d9ce412154412b70c1a7e1beabc3e632ff73f0R70-R77)
)RealAccounts
,NoNonEuAccounts
, andNonEUAccounts
to utilize theresidence
property for conditional logic and rendering. ([[1]](https://github.com/deriv-com/bot/pull/455/files#diff-4de4e43d901612b973866c07cad955bf91f25d95a235e111d1dcd15b39edcbeeR24)
,[[2]](https://github.com/deriv-com/bot/pull/455/files#diff-fa0242e511a8bc020e881a84c3155a89d3e3153c2477befa969e2eb1ac44d00fL35-R48)
,[[3]](https://github.com/deriv-com/bot/pull/455/files#diff-3ba8aeb8ea93c81cd3a31e10ea623151a3fce656854efaf7b532522d7e0c0cbcL8-R14)
)Redirection Logic Updates:
handleTraderHubRedirect
calls to include additional parameters (residence
,hubEnabledCountryList
) for more precise redirection logic. ([[1]](https://github.com/deriv-com/bot/pull/455/files#diff-948b4480a9b3fd95a8a64f3416c7af8d1482e4098d2b2d792adf21416d821bd5L42-R51)
,[[2]](https://github.com/deriv-com/bot/pull/455/files#diff-8093d4ae9559ad56dcce6cf76b37866860279c27066a8dc0d2f2e3769d543d7aL56-R66)
,[[3]](https://github.com/deriv-com/bot/pull/455/files#diff-7431f2f873b7b5cbcd9127a9c3985b9f7f8fa732f8fc2cc0c136d8f7c878fa8cR7-R42)
,[[4]](https://github.com/deriv-com/bot/pull/455/files#diff-fa0242e511a8bc020e881a84c3155a89d3e3153c2477befa969e2eb1ac44d00fL35-R48)
)featureFlagValue.hub_enabled_country_list
checks withhubEnabledCountryList
for determining Trader's Hub eligibility. ([src/components/layout/header/AccountSwitcherWallet/account-switcher-wallet-mobile.tsxL78-R84](https://github.com/deriv-com/bot/pull/455/files#diff-948b4480a9b3fd95a8a64f3416c7af8d1482e4098d2b2d792adf21416d821bd5L78-R84)
)Code Cleanup and Formatting:
[[1]](https://github.com/deriv-com/bot/pull/455/files#diff-948b4480a9b3fd95a8a64f3416c7af8d1482e4098d2b2d792adf21416d821bd5L99-R109)
,[[2]](https://github.com/deriv-com/bot/pull/455/files#diff-948b4480a9b3fd95a8a64f3416c7af8d1482e4098d2b2d792adf21416d821bd5L119-R132)
,[[3]](https://github.com/deriv-com/bot/pull/455/files#diff-948b4480a9b3fd95a8a64f3416c7af8d1482e4098d2b2d792adf21416d821bd5L132-R146)
)These changes collectively enhance the flexibility and maintainability of the account switcher components by centralizing country-specific logic and improving the handling of user-specific properties like residence.