@bigbinary/neeto-commons-rn 1.0.90 → 1.0.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.TextWithUrl=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _neetouiRn=require("@bigbinary/neetoui-rn");var _propTypes=_interopRequireDefault(require("prop-types"));var _constants=require("./constants");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["text"];var _this=this,_jsxFileName="/home/runner/work/neeto-commons-rn/neeto-commons-rn/src/components/TextWithUrl.jsx";var TextWithUrl=exports.TextWithUrl=function TextWithUrl(_ref){var text=_ref.text,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);if(typeof text!=="string")return text;var parts=text.split(_constants.VALID_URL_EMAIL_REGEX);return parts.map(function(part,index){if(_constants.VALID_URL_EMAIL_REGEX.test(part)){var isEmailPresent=_constants.VALID_EMAIL_REGEX.test(part);return(0,_jsxRuntime.jsx)(_reactNative.TouchableWithoutFeedback,{onPress:function onPress(){return isEmailPresent?_reactNative.Linking.openURL("mailto:"+part):_reactNative.Linking.openURL(part);},children:(0,_jsxRuntime.jsx)(_neetouiRn.Typography,{color:"font.blue",
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.TextWithUrl=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _neetouiRn=require("@bigbinary/neetoui-rn");var _propTypes=_interopRequireDefault(require("prop-types"));var _constants=require("./constants");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["text"];var _this=this,_jsxFileName="/home/runner/work/neeto-commons-rn/neeto-commons-rn/src/components/TextWithUrl.jsx";var TextWithUrl=exports.TextWithUrl=function TextWithUrl(_ref){var text=_ref.text,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);if(typeof text!=="string")return text;var parts=text.split(_constants.VALID_URL_EMAIL_REGEX);return parts.map(function(part,index){if(_constants.VALID_URL_EMAIL_REGEX.test(part)){var isEmailPresent=_constants.VALID_EMAIL_REGEX.test(part);return(0,_jsxRuntime.jsx)(_reactNative.TouchableWithoutFeedback,{onPress:function onPress(){return isEmailPresent?_reactNative.Linking.openURL("mailto:"+part):_reactNative.Linking.openURL(part);},children:(0,_jsxRuntime.jsx)(_neetouiRn.Typography,Object.assign({fontSize:"l"},rest,{color:"font.blue",children:part}))},index);}return(0,_jsxRuntime.jsx)(_neetouiRn.Typography,Object.assign({},rest,{children:part}),index);});};TextWithUrl.propTypes={text:_propTypes.default.oneOfType([_propTypes.default.string,_propTypes.default.number]).isRequired,rest:_propTypes.default.object};TextWithUrl.defaultProps={text:"",rest:{}};
|