Skip to content

Commit

Permalink
code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
kamijin-fanta committed Oct 14, 2022
1 parent bb61ab8 commit d31f86a
Show file tree
Hide file tree
Showing 39 changed files with 259 additions and 228 deletions.
9 changes: 4 additions & 5 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ extends:
- plugin:react/recommended
- plugin:@typescript-eslint/recommended
overrides: []
parser: '@typescript-eslint/parser'
parser: "@typescript-eslint/parser"
parserOptions:
ecmaVersion: latest
sourceType: module
plugins:
- react
- '@typescript-eslint'
- "@typescript-eslint"
rules:
'@typescript-eslint/no-var-requires': 0 # todo remove
'react/prop-types': 0

"@typescript-eslint/no-var-requires": 0 # todo remove
"react/prop-types": 0
10 changes: 5 additions & 5 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: Bug report
about: Create a report to help us improve

---

**Describe the bug**
Expand All @@ -17,10 +16,11 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- Device: [e.g. PC, iPhone6]
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

- Device: [e.g. PC, iPhone6]
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
11 changes: 6 additions & 5 deletions .github/ISSUE_TEMPLATE/build-problems.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: Build problems
about: Build problems such as webpack

---

**Describe the problems**
Expand All @@ -14,15 +13,17 @@ Gist/Github URL
A clear and concise description of what you expected to happen.

**Errors**

```
If an error occurs, paste the output.
```

**Desktop (please complete the following information):**
- Device: [e.g. PC, iPhone6]
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

- Device: [e.g. PC, iPhone6]
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: Feature request
about: Suggest an idea for this project

---

**Is your feature request related to a problem? Please describe.**
Expand Down
78 changes: 39 additions & 39 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,42 @@ jobs:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn --immutable
if: steps.restore-cache.outputs.cache-hit != 'true'
- name: Build Packages
run: BASE_PATH=/react-icons ./build-script.sh
- uses: actions/upload-artifact@v2
with:
path: packages/_react-icons_*/*.tgz
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./packages/preview/out
if: github.ref == 'refs/heads/master'
- name: Release
uses: ncipollo/release-action@v1
with:
artifacts: "packages/_react-icons_*/*.tgz"
bodyFile: "packages/react-icons/VERSIONS"
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: ${{ contains(github.ref, 'snapshot') }}
if: contains(github.ref, 'tags/')
- uses: actions/checkout@v2
with:
submodules: true
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn --immutable
if: steps.restore-cache.outputs.cache-hit != 'true'
- name: Build Packages
run: BASE_PATH=/react-icons ./build-script.sh
- uses: actions/upload-artifact@v2
with:
path: packages/_react-icons_*/*.tgz
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./packages/preview/out
if: github.ref == 'refs/heads/master'
- name: Release
uses: ncipollo/release-action@v1
with:
artifacts: "packages/_react-icons_*/*.tgz"
bodyFile: "packages/react-icons/VERSIONS"
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: ${{ contains(github.ref, 'snapshot') }}
if: contains(github.ref, 'tags/')
4 changes: 2 additions & 2 deletions .netlify/state.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"siteId": "757074ef-6b9d-4bb8-b35d-274477b1b051"
}
"siteId": "757074ef-6b9d-4bb8-b35d-274477b1b051"
}
4 changes: 2 additions & 2 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
overrides:
- files:
- "*.tsx"
- "*.ts"
- "*.tsx"
- "*.ts"
options:
parser: typescript
10 changes: 5 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"search.exclude": {
"**/packages/react-icons/src/icons/*/**": true,
"**/packages/react-icons/src/icons/*/**": true
},
// "editor.codeActionsOnSave": {
// "source.fixAll": true
// },
// "editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": true
},
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"files.insertFinalNewline": true
}
123 changes: 69 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,19 @@ npm install react-icons --save
example usage

```jsx
import { FaBeer } from 'react-icons/fa';
import { FaBeer } from "react-icons/fa";

function Question(){
function Question() {
return (
<h3> Lets go for a <FaBeer />? </h3>
)
<h3>
{" "}
Lets go for a <FaBeer />?{" "}
</h3>
);
}
```
[View the documentation](https://react-icons.github.io/react-icons) for further usage examples and how to use icons from other packages. *NOTE*: each Icon package has it's own subfolder under `react-icons` you import from.
[View the documentation](https://react-icons.github.io/react-icons) for further usage examples and how to use icons from other packages. _NOTE_: each Icon package has it's own subfolder under `react-icons` you import from.
For example, to use an icon from **Material Design**, your import would be: `import { ICON_NAME } from 'react-icons/md';`
Expand All @@ -49,44 +52,46 @@ example usage
```jsx
import { FaBeer } from "@react-icons/all-files/fa/FaBeer";

function Question(){
function Question() {
return (
<h3> Lets go for a <FaBeer />? </h3>
)
<h3>
{" "}
Lets go for a <FaBeer />?{" "}
</h3>
);
}
```
## Icons
Icon Library|License|Version|Count
---|---|---|---
[Circum Icons](https://circumicons.com/)|[MPL-2.0 license](https://github.com/Klarr-Agency/Circum-Icons/blob/main/LICENSE)|1.1|285
[Font Awesome](https://fontawesome.com/)|[CC BY 4.0 License](https://creativecommons.org/licenses/by/4.0/)|5.15.4 7d3d774145ac38663f6d1effc6def0334b68ab7e|1612
[Ionicons 4](https://ionicons.com/)|[MIT](https://github.com/ionic-team/ionicons/blob/master/LICENSE)|4.6.3|696
[Ionicons 5](https://ionicons.com/)|[MIT](https://github.com/ionic-team/ionicons/blob/master/LICENSE)|5.5.0|1332
[Material Design icons](http://google.github.io/material-design-icons/)|[Apache License Version 2.0](https://github.com/google/material-design-icons/blob/master/LICENSE)|4.0.0-12-g63c5cb3060 63c5cb306073a9ecdfd3579f0f696746ab6305f6|3650
[Typicons](http://s-ings.com/typicons/)|[CC BY-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0/)|2.1.2|336
[Github Octicons icons](https://octicons.github.com/)|[MIT](https://github.com/primer/octicons/blob/master/LICENSE)|8.5.0|184
[Feather](https://feathericons.com/)|[MIT](https://github.com/feathericons/feather/blob/master/LICENSE)|4.28.0|286
[Game Icons](https://game-icons.net/)|[CC BY 3.0](https://creativecommons.org/licenses/by/3.0/)|12920d6565588f0512542a3cb0cdfd36a497f910|4040
[Weather Icons](https://erikflowers.github.io/weather-icons/)|[SIL OFL 1.1](http://scripts.sil.org/OFL)|2.0.12|219
[Devicons](https://vorillaz.github.io/devicons/)|[MIT](https://opensource.org/licenses/MIT)|1.8.0|192
[Ant Design Icons](https://github.com/ant-design/ant-design-icons)|[MIT](https://opensource.org/licenses/MIT)|4.2.1|789
[Bootstrap Icons](https://github.com/twbs/icons)|[MIT](https://opensource.org/licenses/MIT)|1.5.0|1846
[Remix Icon](https://github.com/Remix-Design/RemixIcon)|[Apache License Version 2.0](http://www.apache.org/licenses/)|2.5.0|2271
[Flat Color Icons](https://github.com/icons8/flat-color-icons)|[MIT](https://opensource.org/licenses/MIT)|1.0.2|329
[Grommet-Icons](https://github.com/grommet/grommet-icons)|[Apache License Version 2.0](http://www.apache.org/licenses/)|4.6.2|615
[Heroicons](https://github.com/tailwindlabs/heroicons)|[MIT](https://opensource.org/licenses/MIT)|1.0.4|460
[Heroicons 2](https://github.com/tailwindlabs/heroicons)|[MIT](https://opensource.org/licenses/MIT)|2.0.8|530
[Simple Icons](https://simpleicons.org/)|[CC0 1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/)|5.16.0|2024
[Simple Line Icons](https://thesabbir.github.io/simple-line-icons/)|[MIT](https://github.com/primer/octicons/blob/master/LICENSE)|2.5.4|189
[IcoMoon Free](https://github.com/Keyamoon/IcoMoon-Free)|[CC BY 4.0 License](undefined)|d006795ede82361e1bac1ee76f215cf1dc51e4ca|491
[BoxIcons](https://github.com/atisawd/boxicons)|[CC BY 4.0 License](undefined)|2.0.9|757
[css.gg](https://github.com/astrit/css.gg)|[MIT](https://opensource.org/licenses/MIT)|2.0.0|704
[VS Code Icons](https://github.com/microsoft/vscode-codicons)|[CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)|0.0.23|383
[Tabler Icons](https://github.com/tabler/tabler-icons)|[MIT](https://opensource.org/licenses/MIT)|1.68.0|1978
[Themify Icons](https://github.com/lykmapipo/themify-icons)|[MIT](https://github.com/thecreation/standard-icons/blob/master/modules/themify-icons/LICENSE)|1.0.1|352
| Icon Library | License | Version | Count |
| ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | ----- |
| [Circum Icons](https://circumicons.com/) | [MPL-2.0 license](https://github.com/Klarr-Agency/Circum-Icons/blob/main/LICENSE) | 1.1 | 285 |
| [Font Awesome](https://fontawesome.com/) | [CC BY 4.0 License](https://creativecommons.org/licenses/by/4.0/) | 5.15.4 7d3d774145ac38663f6d1effc6def0334b68ab7e | 1612 |
| [Ionicons 4](https://ionicons.com/) | [MIT](https://github.com/ionic-team/ionicons/blob/master/LICENSE) | 4.6.3 | 696 |
| [Ionicons 5](https://ionicons.com/) | [MIT](https://github.com/ionic-team/ionicons/blob/master/LICENSE) | 5.5.0 | 1332 |
| [Material Design icons](http://google.github.io/material-design-icons/) | [Apache License Version 2.0](https://github.com/google/material-design-icons/blob/master/LICENSE) | 4.0.0-12-g63c5cb3060 63c5cb306073a9ecdfd3579f0f696746ab6305f6 | 3650 |
| [Typicons](http://s-ings.com/typicons/) | [CC BY-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0/) | 2.1.2 | 336 |
| [Github Octicons icons](https://octicons.github.com/) | [MIT](https://github.com/primer/octicons/blob/master/LICENSE) | 8.5.0 | 184 |
| [Feather](https://feathericons.com/) | [MIT](https://github.com/feathericons/feather/blob/master/LICENSE) | 4.28.0 | 286 |
| [Game Icons](https://game-icons.net/) | [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/) | 12920d6565588f0512542a3cb0cdfd36a497f910 | 4040 |
| [Weather Icons](https://erikflowers.github.io/weather-icons/) | [SIL OFL 1.1](http://scripts.sil.org/OFL) | 2.0.12 | 219 |
| [Devicons](https://vorillaz.github.io/devicons/) | [MIT](https://opensource.org/licenses/MIT) | 1.8.0 | 192 |
| [Ant Design Icons](https://github.com/ant-design/ant-design-icons) | [MIT](https://opensource.org/licenses/MIT) | 4.2.1 | 789 |
| [Bootstrap Icons](https://github.com/twbs/icons) | [MIT](https://opensource.org/licenses/MIT) | 1.5.0 | 1846 |
| [Remix Icon](https://github.com/Remix-Design/RemixIcon) | [Apache License Version 2.0](http://www.apache.org/licenses/) | 2.5.0 | 2271 |
| [Flat Color Icons](https://github.com/icons8/flat-color-icons) | [MIT](https://opensource.org/licenses/MIT) | 1.0.2 | 329 |
| [Grommet-Icons](https://github.com/grommet/grommet-icons) | [Apache License Version 2.0](http://www.apache.org/licenses/) | 4.6.2 | 615 |
| [Heroicons](https://github.com/tailwindlabs/heroicons) | [MIT](https://opensource.org/licenses/MIT) | 1.0.4 | 460 |
| [Heroicons 2](https://github.com/tailwindlabs/heroicons) | [MIT](https://opensource.org/licenses/MIT) | 2.0.8 | 530 |
| [Simple Icons](https://simpleicons.org/) | [CC0 1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/) | 5.16.0 | 2024 |
| [Simple Line Icons](https://thesabbir.github.io/simple-line-icons/) | [MIT](https://github.com/primer/octicons/blob/master/LICENSE) | 2.5.4 | 189 |
| [IcoMoon Free](https://github.com/Keyamoon/IcoMoon-Free) | [CC BY 4.0 License](undefined) | d006795ede82361e1bac1ee76f215cf1dc51e4ca | 491 |
| [BoxIcons](https://github.com/atisawd/boxicons) | [CC BY 4.0 License](undefined) | 2.0.9 | 757 |
| [css.gg](https://github.com/astrit/css.gg) | [MIT](https://opensource.org/licenses/MIT) | 2.0.0 | 704 |
| [VS Code Icons](https://github.com/microsoft/vscode-codicons) | [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) | 0.0.23 | 383 |
| [Tabler Icons](https://github.com/tabler/tabler-icons) | [MIT](https://opensource.org/licenses/MIT) | 1.68.0 | 1978 |
| [Themify Icons](https://github.com/lykmapipo/themify-icons) | [MIT](https://github.com/thecreation/standard-icons/blob/master/modules/themify-icons/LICENSE) | 1.0.1 | 352 |
You can add more icons by submitting pull requests or creating issues.
Expand All @@ -103,16 +108,16 @@ import { IconContext } from "react-icons";
<div>
<FaFolder />
</div>
</IconContext.Provider>
</IconContext.Provider>;
```
| Key | Default | Notes |
| ----------- | --------------------- | ------------------------------- |
| `color` | `undefined` (inherit) | |
| `size` | `1em` | |
| `className` | `undefined` | |
| `style` | `undefined` | Can overwrite size and color |
| `attr` | `undefined` | Overwritten by other attributes |
| Key | Default | Notes |
| ----------- | --------------------- | ---------------------------------- |
| `color` | `undefined` (inherit) | |
| `size` | `1em` | |
| `className` | `undefined` | |
| `style` | `undefined` | Can overwrite size and color |
| `attr` | `undefined` | Overwritten by other attributes |
| `title` | `undefined` | Icon description for accessibility |
## Migrating from version 2 -> 3
Expand All @@ -123,23 +128,29 @@ Import path has changed. You need to rewrite from the old style.
```jsx
// OLD IMPORT STYLE
import FaBeer from 'react-icons/lib/fa/beer';
import FaBeer from "react-icons/lib/fa/beer";

function Question(){
function Question() {
return (
<h3> Lets go for a <FaBeer />? </h3>
)
<h3>
{" "}
Lets go for a <FaBeer />?{" "}
</h3>
);
}
```
```jsx
// NEW IMPORT STYLE
import { FaBeer } from 'react-icons/fa';
import { FaBeer } from "react-icons/fa";

function Question(){
return (
<h3> Lets go for a <FaBeer />? </h3>
)
function Question() {
return (
<h3>
{" "}
Lets go for a <FaBeer />?{" "}
</h3>
);
}
```
Expand Down Expand Up @@ -176,11 +187,13 @@ CSS
Dependencies on `@types/react-icons` can be deleted.
#### Yarn
```bash
yarn remove @types/react-icons
```
#### NPM
```bash
npm remove @types/react-icons
```
Expand All @@ -197,6 +210,7 @@ yarn build
```
### Preview
The preview site is the [`react-icons`](https://react-icons.github.io/react-icons) website, built in [NextJS](https://nextjs.org/).
```bash
Expand All @@ -208,6 +222,7 @@ yarn start
```
### Demo
The demo is a [Create React App](https://create-react-app.dev/) boilerplate with `react-icons` added as a dependency for easy testing.
```bash
Expand Down
Loading

0 comments on commit d31f86a

Please sign in to comment.