mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 07:26:02 +01:00
feat(web): font awesome icon animations
This commit is contained in:
30
web/src/components/LibIcon.tsx
Normal file
30
web/src/components/LibIcon.tsx
Normal 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;
|
||||
Reference in New Issue
Block a user