From f672f0bc8591ad74d605b3d42ed08e061eb5b046 Mon Sep 17 00:00:00 2001 From: Dylan Vann Date: Sun, 24 Feb 2019 23:54:24 -0500 Subject: [PATCH] chore: More social. --- README.md | 140 +++++++++++++++++++++++++++++------------------------- 1 file changed, 76 insertions(+), 64 deletions(-) diff --git a/README.md b/README.md index 694f15a..91dff15 100644 --- a/README.md +++ b/README.md @@ -2,27 +2,21 @@ 🚩 FastImage -

- Performant React Native image component. -

+
-

- - npm package - - - npm downloads - - - CircleCI build status - - - codecov - - - license - -

+Performant React Native image component. + +[![Version][version-badge]][package] +[![Downloads][downloads-badge]][npmtrends] +[![Build Status][build-badge]][build] +[![Code Coverage][coverage-badge]][coverage] +[![MIT License][license-badge]][license] + +[![Watch on GitHub][github-watch-badge]][github-watch] +[![Star on GitHub][github-star-badge]][github-star] +[![Tweet][twitter-badge]][twitter] + +

@@ -42,10 +36,10 @@ headers for images you'll generally get the sort of built in caching behavior you'd have in a browser. Even so many people have noticed: -- Flickering. -- Cache misses. -- Low performance loading from cache. -- Low performance in general. +- Flickering. +- Cache misses. +- Low performance loading from cache. +- Low performance in general. `FastImage` is an `Image` replacement that solves these issues. `FastImage` is a wrapper around @@ -55,12 +49,12 @@ and ## Features -- [x] Aggressively cache images. -- [x] Add authorization headers. -- [x] Prioritize images. -- [x] Preload images. -- [x] GIF support. -- [x] Border radius. +- [x] Aggressively cache images. +- [x] Add authorization headers. +- [x] Prioritize images. +- [x] Preload images. +- [x] GIF support. +- [x] Border radius. ## Usage @@ -75,23 +69,24 @@ react-native link react-native-fast-image ```jsx import FastImage from 'react-native-fast-image' -const YourImage = () => - +const YourImage = () => ( + +) ``` ## Other Linking Methods -- [Manual](docs/installation-manual.md) (might be needed if something went wrong with `react-native link`) -- [CocoaPods (iOS)](docs/installation-cocoapods.md) (you may wish to use this if you are already using CocoaPods) -- [Are you using Glide already using an AppGlideModule?](docs/app-glide-module.md) (you might have problems if you don't read this) +- [Manual](docs/installation-manual.md) (might be needed if something went wrong with `react-native link`) +- [CocoaPods (iOS)](docs/installation-cocoapods.md) (you may wish to use this if you are already using CocoaPods) +- [Are you using Glide already using an AppGlideModule?](docs/app-glide-module.md) (you might have problems if you don't read this) ## Proguard @@ -124,26 +119,26 @@ Headers to load the image with. e.g. `{ Authorization: 'someAuthToken' }`. ### `source.priority?: enum` -- `FastImage.priority.low` - Low Priority. -- `FastImage.priority.normal` **(Default)** - Normal Priority. -- `FastImage.priority.high` - High Priority. +- `FastImage.priority.low` - Low Priority. +- `FastImage.priority.normal` **(Default)** - Normal Priority. +- `FastImage.priority.high` - High Priority. --- ### `source.cache?: enum` -- `FastImage.cacheControl.immutable` - **(Default)** - Only updates if url changes. -- `FastImage.cacheControl.web` - Use headers and follow normal caching procedures. -- `FastImage.cacheControl.cacheOnly` - Only show images from cache, do not make any network requests. +- `FastImage.cacheControl.immutable` - **(Default)** - Only updates if url changes. +- `FastImage.cacheControl.web` - Use headers and follow normal caching procedures. +- `FastImage.cacheControl.cacheOnly` - Only show images from cache, do not make any network requests. --- ### `resizeMode?: enum` -- `FastImage.resizeMode.contain` - Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or less than the corresponding dimension of the view (minus padding). -- `FastImage.resizeMode.cover` **(Default)** - Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or larger than the corresponding dimension of the view (minus padding). -- `FastImage.resizeMode.stretch` - Scale width and height independently, This may change the aspect ratio of the src. -- `FastImage.resizeMode.center` - Do not scale the image, keep centered. +- `FastImage.resizeMode.contain` - Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or less than the corresponding dimension of the view (minus padding). +- `FastImage.resizeMode.cover` **(Default)** - Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or larger than the corresponding dimension of the view (minus padding). +- `FastImage.resizeMode.stretch` - Scale width and height independently, This may change the aspect ratio of the src. +- `FastImage.resizeMode.center` - Do not scale the image, keep centered. --- @@ -200,14 +195,14 @@ Preload images to display later. e.g. ```js FastImage.preload([ - { - uri: 'https://facebook.github.io/react/img/logo_og.png', - headers: { Authorization: 'someAuthToken' }, - }, - { - uri: 'https://facebook.github.io/react/img/logo_og.png', - headers: { Authorization: 'someAuthToken' }, - }, + { + uri: 'https://facebook.github.io/react/img/logo_og.png', + headers: { Authorization: 'someAuthToken' }, + }, + { + uri: 'https://facebook.github.io/react/img/logo_og.png', + headers: { Authorization: 'someAuthToken' }, + }, ]) ``` @@ -236,6 +231,23 @@ It also uses Glide and SDWebImage, but didn't have some features I needed (prior ## Licenses -* FastImage - `MIT` -* SDWebImage - `MIT` -* Glide - `Apache-2.0` +- FastImage - MIT © [DylanVann](https://github.com/DylanVann) +- SDWebImage - `MIT` +- Glide - `Apache-2.0` + +[build-badge]: https://img.shields.io/circleci/project/github/DylanVann/react-native-fast-image/master.svg?style=flat-square +[build]: https://circleci.com/gh/DylanVann/react-native-fast-image/tree/master +[coverage-badge]: https://img.shields.io/codecov/c/github/dylanvann/react-native-fast-image.svg?style=flat-square +[coverage]: https://codecov.io/github/dylanvann/react-native-fast-image +[downloads-badge]: https://img.shields.io/npm/dm/react-native-fast-image.svg?style=flat-square +[npmtrends]: http://www.npmtrends.com/react-native-fast-image +[package]: https://www.npmjs.com/package/react-native-fast-image +[version-badge]: https://img.shields.io/npm/v/react-native-fast-image.svg?style=flat-square +[license-badge]: https://img.shields.io/npm/l/react-native-fast-image.svg?style=flat-square +[license]: https://github.com/dylanvann/react-native-fast-image/blob/master/LICENSE +[twitter]: https://twitter.com/home?status=Check%20out%20react-native-fast-image%20by%20%40atomarranger%20https%3A//github.com/DylanVann/react-native-fast-image +[twitter-badge]: https://img.shields.io/twitter/url/https/github.com/DylanVann/react-native-fast-image.svg?style=social +[github-watch-badge]: https://img.shields.io/github/watchers/dylanvann/react-native-fast-image.svg?style=social +[github-watch]: https://github.com/dylanvann/react-native-fast-image/watchers +[github-star-badge]: https://img.shields.io/github/stars/dylanvann/react-native-fast-image.svg?style=social +[github-star]: https://github.com/dylanvann/react-native-fast-image/stargazers