react-native-gifted-spinner
Advanced tools
Comparing version 0.0.5 to 0.1.0
@@ -1,36 +0,14 @@ | ||
'use strict' | ||
import React, { Component } from 'react'; | ||
import { ActivityIndicator } from 'react-native'; | ||
import React, { Component, PropTypes } from 'react'; | ||
import { View, ProgressBarAndroid, Platform, ActivityIndicator } from 'react-native'; | ||
export default class GiftedSpinner extends Component { | ||
_getSpinner = () => { | ||
if (Platform.OS === 'android') { | ||
return ( | ||
<ProgressBarAndroid | ||
style={{ | ||
height: 20, | ||
}} | ||
styleAttr="Inverse" | ||
{...this.props} | ||
/> | ||
); | ||
} else { | ||
return ( | ||
<ActivityIndicator | ||
animating={true} | ||
size="small" | ||
{...this.props} | ||
/> | ||
); | ||
} | ||
} | ||
render() { | ||
return ( | ||
<View> | ||
{this._getSpinner()} | ||
</View> | ||
<ActivityIndicator | ||
animating={true} | ||
size="small" | ||
{...this.props} | ||
/> | ||
); | ||
} | ||
} | ||
} | ||
} |
{ | ||
"name": "react-native-gifted-spinner", | ||
"version": "0.0.5", | ||
"description": "Simple loading spinner that use React-Native ProgressBarAndroid or ActivityIndicatorIOS depending of the platform", | ||
"version": "0.1.0", | ||
"description": "ActivityIndicator wrapper. Circular loading indicator", | ||
"main": "GiftedSpinner.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
@@ -1,46 +0,28 @@ | ||
# react-native-gifted-spinner | ||
# Gifted Spinner | ||
#### This package is now deprecated. [ActivityIndicator](https://facebook.github.io/react-native/docs/activityindicator.html) should be used instead | ||
This component is now deprecated. Use [ActivityIndicator](https://facebook.github.io/react-native/docs/activityindicator.html) instead. | ||
### Installation | ||
`npm install react-native-gifted-spinner --save` | ||
Simple loading spinner that use React-Native ProgressBarAndroid or ActivityIndicatorIOS depending of the platform. | ||
![](https://raw.githubusercontent.com/FaridSafi/react-native-gifted-spinner/master/screenshot/screenshot.png) | ||
### Example | ||
```js | ||
var React = require('react-native'); | ||
var { | ||
View, | ||
} = React; | ||
```javascript | ||
import React, { Component } from 'react'; | ||
import GiftedSpinner from 'react-native-gifted-spinner'; | ||
var GiftedSpinner = require('react-native-gifted-spinner'); | ||
var Example = React.createClass({ | ||
export default class Example extends Component { | ||
render() { | ||
return ( | ||
<View style={{ | ||
flex: 1, | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
}}> | ||
<GiftedSpinner /> | ||
</View> | ||
<GiftedSpinner /> | ||
); | ||
} | ||
}); | ||
} | ||
``` | ||
### Installation | ||
```npm install react-native-gifted-spinner --save``` | ||
### License | ||
[MIT](LICENSE.md) | ||
[MIT](LICENSE) | ||
Feel free to ask me questions on Twitter [@FaridSafi](https://www.twitter.com/FaridSafi) ! |
Sorry, the diff of this file is not supported yet
2672
13
29