feat(web): font awesome icon animations

This commit is contained in:
Luke
2023-11-15 15:28:21 +01:00
parent a50f7a2052
commit 882e372895
24 changed files with 124 additions and 47 deletions

View File

@@ -0,0 +1,30 @@
import { FontAwesomeIcon, FontAwesomeIconProps } from '@fortawesome/react-fontawesome';
export type IconAnimation =
| 'spin'
| 'spinPulse'
| 'spinReverse'
| 'pulse'
| 'beat'
| 'fade'
| 'beatFade'
| 'bounce'
| 'shake';
const LibIcon: React.FC<FontAwesomeIconProps & { animation?: IconAnimation }> = (props) => {
const animationProps = {
spin: props.animation === 'spin',
spinPulse: props.animation === 'spinPulse',
spinReverse: props.animation === 'spinReverse',
pulse: props.animation === 'pulse',
beat: props.animation === 'beat',
fade: props.animation === 'fade',
beatFade: props.animation === 'beatFade',
bounce: props.animation === 'bounce',
shake: props.animation === 'shake',
};
return <FontAwesomeIcon {...props} {...animationProps} />;
};
export default LibIcon;