From b5a2e5065c149b4424bc464ae56cd2ace6cb7800 Mon Sep 17 00:00:00 2001 From: robmadole Date: Thu, 6 Sep 2018 13:51:35 -0500 Subject: [PATCH] Release 0.1.3 --- CHANGELOG.md | 8 ++++++++ README.md | 1 + index.es.js | 12 ++++++++++-- index.js | 12 ++++++++++-- package.json | 9 +++++++-- 5 files changed, 36 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bfeb43a..fa0e09c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p --- +## [0.1.3](https://github.com/FortAwesome/react-fontawesome/releases/tag/0.1.3) - 2018-09-06 + +### Added + +- Add title prop #180 + +--- + ## [0.1.2](https://github.com/FortAwesome/react-fontawesome/releases/tag/0.1.2) - 2018-08-12 ### Changed diff --git a/README.md b/README.md index 8a4cb21f..8afedbbc 100644 --- a/README.md +++ b/README.md @@ -540,6 +540,7 @@ being awesome contributors to this project. **We'd like to take a moment to reco | | Kirk Ross | [@kirkbross](https://github.com/kirkbross) | | | Prateek Goel | [@prateekgoel](https://github.com/prateekgoel) | | | Naor Torgeman | [@naortor](https://github.com/naortor) | +| | Matthew Hand | [@mmhand123](https://github.com/mmhand123) | If we've missed someone (which is quite likely) submit a Pull Request to us and we'll get it resolved. diff --git a/index.es.js b/index.es.js index 94ad217c..e5baf4fc 100644 --- a/index.es.js +++ b/index.es.js @@ -220,6 +220,9 @@ function styleToObject(style) { function convert(createElement, element) { var extraProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + if (typeof element === 'string') { + return element; + } var children = (element.children || []).map(convert.bind(null, createElement)); var mixins = Object.keys(element.attributes || {}).reduce(function (acc, key) { @@ -315,7 +318,8 @@ function FontAwesomeIcon(props) { var iconArgs = props.icon, maskArgs = props.mask, symbol = props.symbol, - className = props.className; + className = props.className, + title = props.title; var iconLookup = normalizeIconArgs(iconArgs); @@ -324,7 +328,8 @@ function FontAwesomeIcon(props) { var mask = objectWithKey('mask', normalizeIconArgs(maskArgs)); var renderedIcon = icon(iconLookup, _extends({}, classes, transform, mask, { - symbol: symbol + symbol: symbol, + title: title })); if (!renderedIcon) { @@ -376,6 +381,8 @@ FontAwesomeIcon.propTypes = { symbol: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]), + title: PropTypes.string, + transform: PropTypes.oneOfType([PropTypes.string, PropTypes.object]) }; @@ -394,6 +401,7 @@ FontAwesomeIcon.defaultProps = { size: null, spin: false, symbol: false, + title: '', transform: null }; diff --git a/index.js b/index.js index 66db6984..56dea989 100644 --- a/index.js +++ b/index.js @@ -225,6 +225,9 @@ function convert(createElement, element) { var extraProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + if (typeof element === 'string') { + return element; + } var children = (element.children || []).map(convert.bind(null, createElement)); var mixins = Object.keys(element.attributes || {}).reduce(function (acc, key) { @@ -320,7 +323,8 @@ var iconArgs = props.icon, maskArgs = props.mask, symbol = props.symbol, - className = props.className; + className = props.className, + title = props.title; var iconLookup = normalizeIconArgs(iconArgs); @@ -329,7 +333,8 @@ var mask = objectWithKey('mask', normalizeIconArgs(maskArgs)); var renderedIcon = fontawesomeSvgCore.icon(iconLookup, _extends({}, classes, transform, mask, { - symbol: symbol + symbol: symbol, + title: title })); if (!renderedIcon) { @@ -381,6 +386,8 @@ symbol: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]), + title: PropTypes.string, + transform: PropTypes.oneOfType([PropTypes.string, PropTypes.object]) }; @@ -399,6 +406,7 @@ size: null, spin: false, symbol: false, + title: '', transform: null }; diff --git a/package.json b/package.json index c8300416..2349136e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@fortawesome/react-fontawesome", "description": "Official React component for Font Awesome 5", - "version": "0.1.2", + "version": "0.1.3", "main": "index.js", "module": "index.es.js", "jsnext:main": "index.es.js", @@ -14,7 +14,12 @@ "contributors": [ "Travis Chase ", "Rob Madole ", - "Mike Wilkerson " + "Mike Wilkerson ", + "Nate Radebaugh ", + "Kirk Ross ", + "Prateek Goel ", + "Naor Torgeman ", + "Matthew Hand " ], "license": "MIT", "scripts": {