react-native-reanimated-player
Version:
A react-native video player that interacts like Youtube player, built upon Reanimted v2 & react-native-gesture-handle
111 lines (108 loc) • 3.09 kB
JavaScript
function _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); }
import React from 'react';
import { Platform, StyleSheet, Text as NativeText } from 'react-native';
import { palette } from '../theme/palette';
const normalize = size => size;
export const Text = /*#__PURE__*/React.forwardRef(function Text(_ref, ref) {
let {
style = {},
h1 = false,
h2 = false,
h3 = false,
h4 = false,
h5 = false,
t1 = false,
t2 = false,
tBold = false,
t3 = false,
t4 = false,
t5 = false,
children = '',
tx = '',
verticalCenter = false,
color = palette.G7(1),
isCenter,
paragraph,
...rest
} = _ref;
return /*#__PURE__*/React.createElement(NativeText, _extends({
ref: ref,
style: StyleSheet.flatten([styles.text, {
color
}, isCenter && styles.textCenter, (t1 || t2 || t3 || t4 || t5) && tBold && styles.enTBold, h1 && StyleSheet.flatten([{
fontSize: normalize(28)
}, !verticalCenter && {
lineHeight: normalize(36)
}, styles.h1]), h2 && StyleSheet.flatten([{
fontSize: normalize(24)
}, !verticalCenter && {
lineHeight: normalize(32)
}, styles.h2]), h3 && StyleSheet.flatten([{
fontSize: normalize(18)
}, !verticalCenter && {
lineHeight: normalize(28)
}, styles.h3]), h4 && StyleSheet.flatten([{
fontSize: normalize(16)
}, !verticalCenter && {
lineHeight: normalize(24)
}, styles.h4]), h5 && StyleSheet.flatten([{
fontSize: normalize(14)
}, !verticalCenter && {
lineHeight: normalize(20)
}, styles.h5]), t1 && StyleSheet.flatten([{
fontSize: normalize(14)
}, !verticalCenter && {
lineHeight: normalize(20)
}]), t2 && StyleSheet.flatten([{
fontSize: normalize(13)
}, !verticalCenter && {
lineHeight: normalize(18)
}]), t3 && StyleSheet.flatten([{
fontSize: normalize(12)
}, !verticalCenter && {
lineHeight: normalize(16)
}]), t4 && StyleSheet.flatten([{
fontSize: normalize(11)
}, !verticalCenter && {
lineHeight: normalize(16)
}]), t5 && StyleSheet.flatten([{
fontSize: normalize(10)
}, !verticalCenter && {
lineHeight: normalize(14)
}]), paragraph && StyleSheet.flatten([{
fontSize: normalize(14),
lineHeight: normalize(24)
}]), style])
}, rest), tx || children);
});
const bold = Platform.OS === 'ios' ? '600' : 'bold';
const styles = StyleSheet.create({
d1: {},
d2: {},
enTBold: {
fontWeight: bold
},
h1: {
fontWeight: bold
},
h2: {
fontWeight: bold
},
h3: {
fontWeight: bold
},
h4: {
fontWeight: bold
},
h5: {
fontWeight: bold
},
text: {
fontSize: normalize(14)
},
textCenter: {
alignSelf: 'center'
}
});
Text.displayName = 'Text';
//# sourceMappingURL=text.js.map