Skip to content

Rupato/replace growthbook config with firebase #455

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

rupato-deriv
Copy link
Contributor

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 the residence property through several components, and updating redirection logic for Trader's Hub and wallets.

Integration of Firebase Country Configurations:

  • Replaced useGrowthbookGetFeatureValue with useFirebaseCountriesConfig in AccountSwitcherWalletMobile, AccountSwitcherWallet, and other related components to use hubEnabledCountryList 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:

  • Added 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))
  • Updated components such as RealAccounts, NoNonEuAccounts, and NonEUAccounts to utilize the residence 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:

  • Modified 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))
  • Replaced featureFlagValue.hub_enabled_country_list checks with hubEnabledCountryList 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:

  • Improved readability by restructuring JSX and TypeScript code, such as reformatting button handlers and component props. ([[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.

Copy link
Contributor

github-actions bot commented Jun 5, 2025

Preview Link: https://Rupato-Replace-growt.bot-65f.pages.dev

Name Result
Build status Completed ✅
Preview URL Visit Preview
Action URL Visit Action

@rupato-deriv rupato-deriv merged commit 35d8c2c into deriv-com:master Jun 9, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant