Skip to content

Commit

Permalink
Release 0.1.14
Browse files Browse the repository at this point in the history
  • Loading branch information
robmadole committed Dec 22, 2020
1 parent acbf6f1 commit 0683a1b
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 9 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p

---

## [0.1.14](https://github.com/FortAwesome/react-fontawesome/releases/tag/0.1.14) - 2020-12-22

### Added

- Support for the new parse.icon function from the Font Awesome version 6 @fortawesome/fontawesome-svg-core

---

## [0.1.13](https://github.com/FortAwesome/react-fontawesome/releases/tag/0.1.13) - 2020-11-23

### Fixed
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
> Font Awesome 5 React component using SVG with JS
<!-- toc -->

- [Documentation](#documentation)
- [How to Help](#how-to-help)
- [Contributors](#contributors)
Expand Down Expand Up @@ -63,6 +64,8 @@ The Font Awesome team:
| <img src="https://github.com/robmadole.png?size=72" /> | Rob Madole | [@robmadole](https://github.com/robmadole) |
| <img src="https://github.com/mlwilkerson.png?size=72" /> | Mike Wilkerson | [@mlwilkerson](https://github.com/mlwilkerson) |
| <img src="https://github.com/talbs.png?size=72" /> | Brian Talbot | [@talbs](https://github.com/talbs) |
| <img src="https://github.com/talbs.png?size=72" /> | Brian Talbot | [@talbs](https://github.com/talbs) |

This comment has been minimized.

Copy link
@utkarshgupta137

utkarshgupta137 Dec 27, 2020

Duplicate

| <img src="https://github.com/jasonlundien.png?size=72" /> | Jason Lundien | [@jasonlundien](https://github.com/jasonlundien) |

## Releasing this project (only project owners can do this)

Expand Down
13 changes: 9 additions & 4 deletions index.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,12 @@ function log () {
}
}

// Normalize icon arguments
function normalizeIconArgs(icon) {
// if the icon is null, there's nothing to do
if (parse.icon) {
return parse.icon(icon);
} // if the icon is null, there's nothing to do


if (icon === null) {
return null;
} // if the icon is an object and has a prefix and an icon name, return it
Expand Down Expand Up @@ -308,14 +311,16 @@ function FontAwesomeIcon(_ref) {
maskArgs = props.mask,
symbol = props.symbol,
className = props.className,
title = props.title;
title = props.title,
titleId = props.titleId;
var iconLookup = normalizeIconArgs(iconArgs);
var classes = objectWithKey('classes', [].concat(_toConsumableArray(classList(props)), _toConsumableArray(className.split(' '))));
var transform = objectWithKey('transform', typeof props.transform === 'string' ? parse.transform(props.transform) : props.transform);
var mask = objectWithKey('mask', normalizeIconArgs(maskArgs));
var renderedIcon = icon(iconLookup, _objectSpread2({}, classes, {}, transform, {}, mask, {
symbol: symbol,
title: title
title: title,
titleId: titleId
}));

if (!renderedIcon) {
Expand Down
13 changes: 9 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,12 @@
}
}

// Normalize icon arguments
function normalizeIconArgs(icon) {
// if the icon is null, there's nothing to do
if (fontawesomeSvgCore.parse.icon) {
return fontawesomeSvgCore.parse.icon(icon);
} // if the icon is null, there's nothing to do


if (icon === null) {
return null;
} // if the icon is an object and has a prefix and an icon name, return it
Expand Down Expand Up @@ -313,14 +316,16 @@
maskArgs = props.mask,
symbol = props.symbol,
className = props.className,
title = props.title;
title = props.title,
titleId = props.titleId;
var iconLookup = normalizeIconArgs(iconArgs);
var classes = objectWithKey('classes', [].concat(_toConsumableArray(classList(props)), _toConsumableArray(className.split(' '))));
var transform = objectWithKey('transform', typeof props.transform === 'string' ? fontawesomeSvgCore.parse.transform(props.transform) : props.transform);
var mask = objectWithKey('mask', normalizeIconArgs(maskArgs));
var renderedIcon = fontawesomeSvgCore.icon(iconLookup, _objectSpread2({}, classes, {}, transform, {}, mask, {
symbol: symbol,
title: title
title: title,
titleId: titleId
}));

if (!renderedIcon) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@fortawesome/react-fontawesome",
"description": "Official React component for Font Awesome 5",
"version": "0.1.13",
"version": "0.1.14",
"main": "index.js",
"module": "index.es.js",
"jsnext:main": "index.es.js",
Expand Down

0 comments on commit 0683a1b

Please sign in to comment.