Skip to content

Commit e91f31f

Browse files
committed
Text - revert Android alignment (#2701)
1 parent 0dac88a commit e91f31f

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

src/components/text/index.tsx

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
import _ from 'lodash';
22
import React, {PureComponent} from 'react';
3-
import {Text as RNText, StyleSheet, TextProps as RNTextProps, TextStyle, Animated, StyleProp} from 'react-native';
3+
import {
4+
Text as RNText,
5+
StyleSheet,
6+
TextProps as RNTextProps,
7+
TextStyle,
8+
Animated,
9+
StyleProp,
10+
Platform
11+
} from 'react-native';
412
import {
513
asBaseComponent,
614
forwardRef,
@@ -116,7 +124,7 @@ class Text extends PureComponent<PropsTypes> {
116124
return (
117125
<RNText
118126
key={index}
119-
style={text.shouldHighlight ? (text.style ?? [styles.highlight, highlightStyle]) : styles.notHighlight}
127+
style={text.shouldHighlight ? text.style ?? [styles.highlight, highlightStyle] : styles.notHighlight}
120128
onPress={text.onPress}
121129
testID={text.testID}
122130
>
@@ -184,8 +192,14 @@ const styles = StyleSheet.create({
184192
container: {
185193
backgroundColor: 'transparent',
186194
color: Colors.$textDefault,
187-
// textAlign: 'left'
188-
writingDirection: Constants.isRTL ? writingDirectionTypes.RTL : writingDirectionTypes.LTR // iOS only
195+
...Platform.select({
196+
ios: {
197+
writingDirection: Constants.isRTL ? writingDirectionTypes.RTL : writingDirectionTypes.LTR
198+
},
199+
android: {
200+
textAlign: 'left'
201+
}
202+
})
189203
},
190204
centered: {
191205
textAlign: 'center'

0 commit comments

Comments
 (0)