UNPKG

1.12 kBJavaScriptView Raw
1function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
3import color from 'color';
4import * as React from 'react';
5import { I18nManager, StyleSheet } from 'react-native';
6import Text from './Text';
7import { withTheme } from '../../core/theming';
8
9const StyledText = _ref => {
10 let {
11 theme,
12 alpha,
13 family,
14 style,
15 ...rest
16 } = _ref;
17 const textColor = color(theme.colors.text).alpha(alpha).rgb().string();
18 const font = theme.fonts[family];
19 const writingDirection = I18nManager.isRTL ? 'rtl' : 'ltr';
20 return /*#__PURE__*/React.createElement(Text, _extends({}, rest, {
21 style: [styles.text, {
22 color: textColor,
23 ...font,
24 writingDirection
25 }, style]
26 }));
27};
28
29const styles = StyleSheet.create({
30 text: {
31 textAlign: 'left'
32 }
33});
34export default withTheme(StyledText);
35//# sourceMappingURL=StyledText.js.map
\No newline at end of file