Skip to content

Commit

Permalink
Fix fade prop and support beat-fade, bounce and shake props (#483) (#484
Browse files Browse the repository at this point in the history
)

Co-authored-by: Alexey Victorov <av@kalite.ro>
  • Loading branch information
AliMamed and Alexey Victorov authored Feb 24, 2022
1 parent 6b6af65 commit 77b9bde
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 12 deletions.
5 changes: 5 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ export interface FontAwesomeIconProps extends BackwardCompatibleOmit<SVGAttribut
color?: string
spin?: boolean
pulse?: boolean
beat?: boolean
fade?: boolean
beatFade?: boolean
bounce?: boolean
shake?: boolean
border?: boolean
fixedWidth?: boolean
inverse?: boolean
Expand Down
11 changes: 11 additions & 0 deletions index.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ function classList(props) {

var beat = props.beat,
fade = props.fade,
beatFade = props.beatFade,
bounce = props.bounce,
shake = props.shake,
flash = props.flash,
spin = props.spin,
spinPulse = props.spinPulse,
Expand All @@ -145,6 +148,9 @@ function classList(props) {
var classes = (_classes = {
'fa-beat': beat,
'fa-fade': fade,
'fa-beat-fade': beatFade,
'fa-bounce': bounce,
'fa-shake': shake,
'fa-flash': flash,
'fa-spin': spin,
'fa-spin-reverse': spinReverse,
Expand Down Expand Up @@ -399,6 +405,11 @@ FontAwesomeIcon.defaultProps = {
rotation: null,
size: null,
spin: false,
beat: false,
fade: false,
beatFade: false,
bounce: false,
shake: false,
symbol: false,
title: '',
transform: null,
Expand Down
11 changes: 11 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@

var beat = props.beat,
fade = props.fade,
beatFade = props.beatFade,
bounce = props.bounce,
shake = props.shake,
flash = props.flash,
spin = props.spin,
spinPulse = props.spinPulse,
Expand All @@ -152,6 +155,9 @@
var classes = (_classes = {
'fa-beat': beat,
'fa-fade': fade,
'fa-beat-fade': beatFade,
'fa-bounce': bounce,
'fa-shake': shake,
'fa-flash': flash,
'fa-spin': spin,
'fa-spin-reverse': spinReverse,
Expand Down Expand Up @@ -406,6 +412,11 @@
rotation: null,
size: null,
spin: false,
beat: false,
fade: false,
beatFade: false,
bounce: false,
shake: false,
symbol: false,
title: '',
transform: null,
Expand Down
40 changes: 29 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"@babel/preset-env": "^7.16.8",
"@babel/preset-react": "^7.16.7",
"@babel/preset-stage-3": "^7.8.3",
"@fortawesome/fontawesome-svg-core": "^1.2.32",
"@fortawesome/fontawesome-svg-core": "^1.3.0",
"@fortawesome/free-solid-svg-icons": "^5.15.4",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^21.0.1",
Expand Down
5 changes: 5 additions & 0 deletions src/components/FontAwesomeIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ FontAwesomeIcon.defaultProps = {
rotation: null,
size: null,
spin: false,
beat: false,
fade: false,
beatFade: false,
bounce: false,
shake: false,
symbol: false,
title: '',
transform: null,
Expand Down
6 changes: 6 additions & 0 deletions src/utils/get-class-list-from-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ export default function classList(props) {
beat,
bounce,
fade,
beatFade,
bounce,
shake,
flash,
spin,
spinPulse,
Expand All @@ -25,6 +28,9 @@ export default function classList(props) {
'fa-beat': beat,
'fa-bounce': bounce,
'fa-fade': fade,
'fa-beat-fade': beatFade,
'fa-bounce': bounce,
'fa-shake': shake,
'fa-flash': flash,
'fa-spin': spin,
'fa-spin-reverse': spinReverse,
Expand Down

0 comments on commit 77b9bde

Please sign in to comment.