moblee-icons
v1.0.6
Published
mobLee UI components
Downloads
9
Keywords
Readme
mobLee-icons
Usage
Install
yarn add moblee-iconsImport
import MenuIcon from 'moblee-icons/Menu';Render
<Menu />Creating a new icon
Suppose your icon is going to be called myIcon.
- Get the SVG file for your custom icon and make sure it measures 24x24px;
- Inside
srccreate a new filemyIcon.js; - As a template, copy the content of
src/Pin.jsto your new file and replace all instances ofPintomyIcon; - Open the your SVG file using a text editor and look for the
<path>tag, copy the content of it'sdattribute. This string describes de shape of the icon; - Inside
myIcon.jsreplacedcontent with the string you copied from the original SVG; - ⚠️ You will probably need to break lines inside
d, to do so, follow this rule: Enter new lines before letters, commas or spaces (a-Z,,or), NEVER split numbers and dots (0-9and.).Pin.jsis a good example; - Open
src/index.jsand add the export:export { default as myIcon } from './myIcon';. Then sort lines (on Atom use:⌘+⇧+P> "Sort Lines: Sort"); - Lastly, to update the storybook open
stories/mobleeIcons.jsand add'myIcon',to the array. (in alphabetical order!)
That's it!! 🎉
You can now check out your brand new icon on the storybook! 😃
Contribute
- Clone the repo:
git clone [email protected]:mobLee/icons - Cd into the directory:
cd icons - Install the dependencies:
yarn - Open a new branch:
git checkout -b feature-nyan-cat - Develop using the storybook:
yarn storybook - Commit your changes:
git add -A . && git commit -m "Add NyanCat icon" - Create a merge request
Publish a new version
- On master branch:
git checkout master - Pull the changes:
git pull - Update
package.jsonversion - Commit the new version:
git commit -am "vX.X.X" - Run the deploy script using NPM:
npm run deploy - Tag the version:
git tag vX.X.X - Push your changes:
git push && git push --tags
