Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
@comparaonline/ui-offer-icons
Advanced tools
A package for manager fontawesome icons.
To getting started with this package you will first install it, so
yarn add @comparaonline/ui-offer-icons
or
npm install @comparaonline/ui-offer-icons
Then just use it as you were using @fortawesome/fontawesome-react
package
import React from 'react';
import { FontAwesomeIcon, Props } from '@comparaonline/ui-offer-icons';
interface MyIconProps extends Props {}
const MyWrapperIcon: React.FunctionalComponent<MyIconProps> = props => {
return <FontAwesomeIcon {...props} />;
};
This package is a wrapper for the FontAwesomeIcon
component, you will receive the normal props as you were using @fortawesome/fontawesome-react
, the only different is that this package only contains certain icons, you can render the icons that are already registered, so here a simple example.
import React from 'react';
import MyWrapperIcon from './FontAwesomeWrapper';
class View extends React.Component {
render() {
return (
<Grid>
<MyWrapperIcon icon={'times'} /> // will render the solid version
<MyWrapperIcon icon={['fal', 'times']} /> // will render the light version
</Grid>
);
}
}
notice that is you just put the icon name as times
will render the solid
version of the pro icons, if you need the light
version so you can render too, but with a little different the prefix
, should be specified as icon={['fal', 'times']}
, in that way you will render the light icons version.
if your don't know the FontAwesomeIcon
props, yopu can find them here
For registering new icons for our library, you can do it like this way:
setup.ts
code
icon, so you should do it likeimport { faCode } from '@fortawesome/pro-solid-svg-icons/faCode';
// you can import the @fortawesome/pro-light-svg-icons/faCode version too and follow the same steps
// append it to the icons array
const icons = [
...,
faCode
];
// then add it to the mapIcons object
const mapIcons = {
[...]: [...],
[faCode.iconName]: faCode.iconName
}
Happy Coding :sunglasses:
FAQs
A package for manager fontawesome icons.
We found that @comparaonline/ui-offer-icons demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 11 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.