Skip to content

Commit

Permalink
Bump prettier and format all files
Browse files Browse the repository at this point in the history
  • Loading branch information
oblador committed Feb 13, 2019
1 parent 546d373 commit 2811ddf
Show file tree
Hide file tree
Showing 7 changed files with 342 additions and 246 deletions.
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ If you wish to submit a pull request for a new feature or issue, you should star

### Setup

* Install [Node.js](https://nodejs.org/) if you have not already. (*We suggest you to use node v6.x.x*)
* Fork the repo
* ```git clone https://github.com/*yourusername*/react-native-vector-icons.git && cd react-native-vector-icons```
* ```yarn install``` OR ```npm install```
* ```npm test```
* Optionally ```brew install fontcustom && npm run build``` if you've updated any icon sets.
- Install [Node.js](https://nodejs.org/) if you have not already. (_We suggest you to use node v6.x.x_)
- Fork the repo
- `git clone https://github.com/*yourusername*/react-native-vector-icons.git && cd react-native-vector-icons`
- `yarn install` OR `npm install`
- `npm test`
- Optionally `brew install fontcustom && npm run build` if you've updated any icon sets.

One you have done this, create a new branch with a name that loosely describes the issue on which you will be working. Once you think you have the addressed the issue in question, submit a pull request to the `master` branch.
3 changes: 1 addition & 2 deletions Examples/IconExplorer/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
IconExplorer
============
# IconExplorer

To run on OSX you must first install `react-native-desktop` with:

Expand Down
41 changes: 22 additions & 19 deletions FONTAWESOME5.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

FontAwesome 5 is split into three different font files which makes it somewhat
harder to use in some cases. The implemented solution should be fairly
straightforward to use after it has been setup.
straightforward to use after it has been setup.
Android and iOS handles fonts differently which is why it could be
easily implemented without any additional setup.

### Table of Content

* [`Usage`](#usage)
* [`Upgrading to Pro`](#upgrading-to-pro)
- [`Usage`](#usage)
- [`Upgrading to Pro`](#upgrading-to-pro)

# Usage

Expand All @@ -18,7 +18,7 @@ Using the standard icons works just like the standard icons in this library.
```javascript
import FontAwesome5 from 'react-native-vector-icons/FontAwesome5';

const icon = (<FontAwesome5 name={'comments'} />);
const icon = <FontAwesome5 name={'comments'} />;
```

Something special about the FontAwesome5 class is that you can also pass props
Expand All @@ -27,17 +27,17 @@ to change the style of the icon:
```javascript
import FontAwesome5 from 'react-native-vector-icons/FontAwesome5';

const icon = (<FontAwesome5 name={'comments'} solid />);
const icon = (<FontAwesome5 name={'git'} brand />);
const icon = <FontAwesome5 name={'comments'} solid />;
const icon = <FontAwesome5 name={'git'} brand />;
```

**Valid types**

| Type | Description |
| --- | --- |
| **brand** | Uses the Brands font |
| **light** | Uses the Light font (pro) or Regular (Free) |
| **solid** | Uses the Solid font |
| Type | Description |
| --------- | ------------------------------------------- |
| **brand** | Uses the Brands font |
| **light** | Uses the Light font (pro) or Regular (Free) |
| **solid** | Uses the Solid font |

No specified type indicates Regular font.

Expand All @@ -46,13 +46,13 @@ Button, TabBarItem etc. works the same way:
```javascript
import FontAwesome5 from 'react-native-vector-icons/FontAwesome5';

const regular_icon_btn = (<FontAwesome5.Button name={'comments'} />);
const solid_icon_btn = (<FontAwesome5.Button name={'comments'} solid />);
const regular_icon_btn = <FontAwesome5.Button name={'comments'} />;
const solid_icon_btn = <FontAwesome5.Button name={'comments'} solid />;
```

## getImageSource

```getImageSource``` works a little different due to its native backend and how
`getImageSource` works a little different due to its native backend and how
the font is separated into different files. Therefore, the enum FA5Style is
defined to help setting the style of the font:

Expand All @@ -70,30 +70,33 @@ Use this to select which style the generated image should have:
```javascript
import FontAwesome5, { FA5Style } from 'react-native-vector-icons/FontAwesome5';

FontAwesome5.getImageSource("comments", 30, '#000', FA5Style.solid).then(source => this.setState({ image: source }));
FontAwesome5.getImageSource('comments', 30, '#000', FA5Style.solid).then(
source => this.setState({ image: source })
);
```

Not passing a style will result in Regular style.

# Upgrading to Pro

You need your FontAwesome npm token which can be obtained by logging into your
account and then access the ```Services``` tab.
account and then access the `Services` tab.

Run ```./node_modules/.bin/fa5-upgrade``` and enter the token when asked to in order to
Run `./node_modules/.bin/fa5-upgrade` and enter the token when asked to in order to
upgrade to the Pro version.

## Manually

If the shell script does not work you can install the Pro version manually.
If the shell script does not work you can install the Pro version manually.
All you really need to do is adding the Pro fonts to your project, there is
instructions on how to do this in main README.md.

## Using the Pro version

Just as easy as using the Free icons, just include the icon set like this:

```javascript
import FontAwesome5Pro from 'react-native-vector-icons/FontAwesome5Pro';

const icon = (<FontAwesome5Pro name={'comments'} light/>);
const icon = <FontAwesome5Pro name={'comments'} light />;
```
Loading

0 comments on commit 2811ddf

Please sign in to comment.