react-obfuscate
Advanced tools
Comparing version 1.2.1 to 1.3.0
@@ -85,3 +85,3 @@ 'use strict'; | ||
}, others), | ||
tel || sms || facetime || email || children | ||
children || tel || sms || facetime || email | ||
); | ||
@@ -105,4 +105,13 @@ } | ||
children = _props2.children, | ||
others = _objectWithoutProperties(_props2, ['tel', 'sms', 'facetime', 'email', 'obfuscate', 'headers', 'children']); | ||
style = _props2.style, | ||
others = _objectWithoutProperties(_props2, ['tel', 'sms', 'facetime', 'email', 'obfuscate', 'headers', 'children', 'style']); | ||
var obsStyle = _extends({}, style || {}, { | ||
unicodeBidi: 'bidi-override' | ||
}); | ||
if (!children) { | ||
obsStyle.direction = 'rtl'; | ||
} | ||
return _react2.default.createElement( | ||
@@ -114,5 +123,5 @@ 'a', | ||
}, others, { | ||
style: { direction: 'rtl', unicodeBidi: 'bidi-override' } | ||
style: obsStyle | ||
}), | ||
this.reverse(tel || sms || facetime || email).replace('(', ')').replace(')', '(') || children | ||
children || this.reverse(tel || sms || facetime || email).replace('(', ')').replace(')', '(') | ||
); | ||
@@ -145,3 +154,4 @@ } | ||
headers: _propTypes.object, | ||
obfuscate: _propTypes.bool | ||
obfuscate: _propTypes.bool, | ||
style: _propTypes.object | ||
}; | ||
@@ -148,0 +158,0 @@ |
{ | ||
"name": "react-obfuscate", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"description": "An intelligent React component to obfuscate any contact link", | ||
@@ -28,13 +28,13 @@ "main": "dist/obfuscate.js", | ||
"devDependencies": { | ||
"babel-cli": "^6.24.1", | ||
"babel-core": "^6.25.0", | ||
"babel-plugin-transform-object-rest-spread": "^6.23.0", | ||
"babel-cli": "^6.26.0", | ||
"babel-core": "^6.26.0", | ||
"babel-plugin-transform-object-rest-spread": "^6.26.0", | ||
"babel-preset-es2015": "^6.24.1", | ||
"babel-preset-react": "^6.24.1", | ||
"chai": "^4.0.2", | ||
"core-js": "^2.4.1", | ||
"mocha": "^4.0.1", | ||
"prop-types": "^15.5.10", | ||
"react": "^16.0.0", | ||
"react-addons-test-utils": "^15.6.0", | ||
"chai": "^4.1.2", | ||
"core-js": "^2.5.3", | ||
"mocha": "^4.1.0", | ||
"prop-types": "^15.6.0", | ||
"react": "^16.2.0", | ||
"react-addons-test-utils": "^15.6.2", | ||
"react-shallow-output": "^0.2.0" | ||
@@ -41,0 +41,0 @@ }, |
@@ -84,2 +84,3 @@ # react-obfuscate | ||
- [bostrom](https://github.com/bostrom) | ||
- [timmygee](https://github.com/timmygee) | ||
@@ -86,0 +87,0 @@ ## Contributing |
@@ -50,3 +50,3 @@ import React, { Component } from 'react' | ||
> | ||
{tel || sms || facetime || email || children} | ||
{children || tel || sms || facetime || email} | ||
</a> | ||
@@ -72,4 +72,15 @@ ) | ||
children, | ||
style, | ||
...others | ||
} = this.props | ||
const obsStyle = { | ||
...(style || {}), | ||
unicodeBidi: 'bidi-override', | ||
}; | ||
if (!children) { | ||
obsStyle.direction = 'rtl'; | ||
} | ||
return ( | ||
@@ -80,7 +91,10 @@ <a | ||
{...others} | ||
style={{ direction: 'rtl', unicodeBidi: 'bidi-override' }} | ||
style={obsStyle} | ||
> | ||
{this.reverse(tel || sms || facetime || email) | ||
.replace('(', ')') | ||
.replace(')', '(') || children} | ||
{ | ||
children || | ||
this.reverse(tel || sms || facetime || email) | ||
.replace('(', ')') | ||
.replace(')', '(') | ||
} | ||
</a> | ||
@@ -105,2 +119,3 @@ ) | ||
obfuscate: bool, | ||
style: object, | ||
} | ||
@@ -107,0 +122,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14460
243
95