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

Support native RTL instead of isRTL conditional #121

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

idanlo
Copy link

@idanlo idanlo commented Mar 28, 2020

You changed your native code to use allowRTL: false (my first commit changes that) so that the application UI is always in LTR mode, you have a property in the redux store called isRTL that with it you can conditionally change position of certain elements, for example flex-start or flex-end, and row or row-reverse - this PR fixes the need for these and you will no longer need to do these conditionals at runtime, meaning that you no longed need the isRTL prop in most of the screens and there is no need for 'prop drilling' which will ultimately cause better performance.

I added the style property direction to the wrapping View in the Loading component (which is the global wrapper to all screens). That property is conditionally ltr or rtl based on the isRTL property from the store, and then you can use flexDirection: 'row', and alignItems: 'flex-start' on all screens without worrying about LTR/RTL!

Also when using position: absolute you can now use start and end instead of left and right, this dynamically sets the position based on the locale and the direction, so while in RTL - end = left, start right, and in LTR - end = right, start = left.

image

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