Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@onramper/flag-icons
Advanced tools
This a package for exporting as React components the SVG files related to flag of countries or of other entities.
This a package for exporting SVG files as React components. The SVG files were imported using Figma API.
FIGMA_TOKEN=$YOUR_TOKEN
FILE_ID=$YOUR_FILE_ID
Follow these instructions to get or create your Figma access token.
The file id can be easily retrieved by accessing your figma file on your browser where you have to extract the value from the URL:
https://www.figma.com/file/`${YOUR_FILE_ID}`/my_figma_file_name
Create a page inside your figma file called 'flags', and add your icons (should be grouped into components)
Run export
$ num run export
The icons added to the 'flag' page will get exported as SVG under a folder with the same name.
npm run build
The build script will export the SVG files from multiple locations (specified in the code as input). The result will be React components for each of the files found.
During the build process, some additional components are constructed to render a specific icon based on a given name, which can be country code or currency ID. For example, the following component should render the flag of United Kindom:
<CountryIcon name="UK" />
These aggregator components are built using the icons-aggregator.js
script.
The following input is received by the algorithm:
const components = [
{
name: "CountryIcon",
dictionary: {
AX: "AlandIslandsIcon",
AF: "AfghanistanIcon",
[...]
}
},
{
name: "CurrencyIcon",
dictionary: {
AUD: "AustraliaIcon",
GBP: "UnitedKingdomIcon",
[...]
}
}
];
FAQs
This a package for exporting as React components the SVG files related to flag of countries or of other entities.
We found that @onramper/flag-icons demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.