Skip to content
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

Local feature flags and Philippines-specific preparation #5444

Closed
annakaz opened this issue Oct 20, 2020 · 1 comment · Fixed by #5613
Closed

Local feature flags and Philippines-specific preparation #5444

annakaz opened this issue Oct 20, 2020 · 1 comment · Fixed by #5613

Comments

@annakaz
Copy link
Contributor

annakaz commented Oct 20, 2020

What's important about this?

Some features within Valora are not available in certain countries. This can be for regulatory reasons like needing to remove the ability to interact with CP-DOTO in the Philippines. Developers need some way to hide or show features based on a user's country.

Definition of done

Developers are able to toggle feature flags at the country level, and have decided on the best definition of country (whether it's user's location, Play Store country, etc). This feature flag is used to disabled CP-DOTO in the Philippines.

This epic includes the work around disabling CP-DOTO in the Philippines, hiding the CELO tab and accounting for edge cases (possible designs needed) in which a Philippines user ends up with CELO.

Out of scope: the ability to remotely toggle feature flags

@annakaz
Copy link
Contributor Author

annakaz commented Oct 20, 2020

CP-DOTO changes were originally in this epic #5425 but have been moved here

@jeanregisser jeanregisser self-assigned this Oct 21, 2020
@mergify mergify bot closed this as completed in #5613 Oct 29, 2020
mergify bot pushed a commit that referenced this issue Oct 29, 2020
…O is restricted (#5613)

### Description

This PR covers the following changes:
- adds country specific feature flags, based on the country of the entered phone number. Flags are defined in `src/flags.ts`, helpers are in `src/utils/countryFeatures.ts ` (there's a `useCountryFeatures` hook for easy usage within components).
- adds the CELO balance to the menu, (hidden if amount is <= 0.001)
- hides the CELO Buy/Sell buttons on the Exchange screen for CP-DOTO restricted countries (only PH for now). In that case we display a "Withdraw" button if the user has any CELO funds.

See [designs on Figma](https://www.figma.com/file/zt7aTQ5wuXycIwxq5oAmF9/Wallet--Refresh?node-id=3136%3A0) (not entirely up-to-date with latest discussions): 

### Other changes

- Upgrade `react-native-reanimated` to fix issue with mock during jest tests
- Add tests for previously uncovered components:
  - `DrawerNavigator`
  - `ExchangeHomeScreen`

### Tested

**Menu (PH, CP-DOTO restricted) with/without CELO balance**

<Img src="https://user-images.githubusercontent.com/57791/97578835-a3273300-19f1-11eb-99c9-008eead7097c.png" width="50%" /><Img src="https://user-images.githubusercontent.com/57791/97578944-c5b94c00-19f1-11eb-98c0-03b5d694c076.png" width="50%" />

**Exchange Home screen (PH, CP-DOTO restricted) with/without CELO balance**

<Img src="https://user-images.githubusercontent.com/57791/97579296-2ba5d380-19f2-11eb-8dea-07a5638f4998.png" width="50%" /><Img src="https://user-images.githubusercontent.com/57791/97579208-129d2280-19f2-11eb-8ac2-cfb898db5c4d.png" width="50%" />

**Menu (US, non CP-DOTO restricted) with/without CELO balance**

<Img src="https://user-images.githubusercontent.com/57791/97579821-d1594280-19f2-11eb-9131-8ba3cbb66c51.png" width="50%" /><Img src="https://user-images.githubusercontent.com/57791/97579855-dae2aa80-19f2-11eb-9afb-5df628b4e568.png" width="50%" />


**Exchange Home screen (non CP-DOTO restricted) with/without CELO balance**

<Img src="https://user-images.githubusercontent.com/57791/97579912-ef26a780-19f2-11eb-8046-41cdd582ffd8.png" width="50%" /><Img src="https://user-images.githubusercontent.com/57791/97579887-e504a900-19f2-11eb-8429-78fdad044673.png" width="50%" />

### Related issues

- Fixes #5444 
- Addresses part of #5425 (Adds CELO balance to the menu)

### Backwards compatibility

Yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants