UNPKG

@hc.ds/mobile

Version:
43 lines (39 loc) 1.26 kB
import React from 'react'; import { View } from 'react-native'; import { library } from '@fortawesome/fontawesome-svg-core'; import { FontAwesomeIcon } from '@fortawesome/react-native-fontawesome'; // Free icon set import { fab } from '@fortawesome/free-brands-svg-icons'; import { fas } from '@fortawesome/free-solid-svg-icons'; import { far } from '@fortawesome/free-regular-svg-icons'; // Pro icon set import { IconSize } from './size'; import { IconTheme } from './theme'; import { IconVariant } from './variant'; library.add(fab, fas, far); /** * @deprecated This component is deprecated. * * Please use `import { Icon } from '@/ui/core/icon/icon';` * * Why: This component lacks PRO icons support. */ export const Icon = props => { const { name, size = 'regular', variant = 'solid', theme = 'primary', testID = 'default' } = props; const iconName = `${IconVariant[variant]} fa-${name.toLowerCase()}`; return /*#__PURE__*/React.createElement(View, { testID: `hcds-mobile-icon-${testID}` }, /*#__PURE__*/React.createElement(FontAwesomeIcon, { icon: iconName, color: IconTheme[theme], size: IconSize[size], testID: `hcds-mobile-icon-${testID}-elm` })); }; //# sourceMappingURL=icon.js.map