https://github.com/djchie/react-native-make-review-modal
A React Native component for displaying a modal for making reviews
https://github.com/djchie/react-native-make-review-modal
Last synced: 8 months ago
JSON representation
A React Native component for displaying a modal for making reviews
- Host: GitHub
- URL: https://github.com/djchie/react-native-make-review-modal
- Owner: djchie
- Created: 2015-11-20T03:21:06.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-11-20T04:53:58.000Z (over 10 years ago)
- Last Synced: 2025-04-14T12:58:17.326Z (about 1 year ago)
- Language: JavaScript
- Size: 10.7 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
# React Native Make Review Modal Component
> A React Native component for displaying a modal for making reviews. Compatible with both iOS and Android.
## Table of Contents
1. [Usage](#usage)
1. [Requirements](#requirements)
1. [Development](#development)
1. [Installing Dependencies](#installing-dependencies)
1. [Running the Scraper](#running-the-scraper)
1. [Handling UCI Data Changes](#handling-uci-data-changes)
1. [Roadmap](#roadmap)
1. [Contributing](#contributing)
## Usage
Install the package via `npm install react-native-make-review-modal --save`. Then require it in your JavaScript file via `require('react-native-make-review-modal')`. Check out an example usage below:
```js
var StarRating = require('react-native-star-rating');
if (Platform.OS === 'android'){
var Portal = require('react-native/Libraries/Portal/Portal');
var tag;
}
var ExampleComponent = React.createClass({
getInitialState: function () {
return {
isReviewModalOpen: false,
};
},
componentWillMount: function() {
if( Platform.OS === 'android' ) {
tag = Portal.allocateTag();
}
},
onMakeReviewButtonPress: function () {
if (Platform.OS === 'android') {
Portal.showModal(tag, );
}
if (Platform.OS === 'ios') {
this.setState({isReviewModalOpen: true});
}
},
onCloseReviewButtonPress: function () {
if (Platform.OS === 'android') {
Portal.closeModal(tag);
}
if (Platform.OS === 'ios') {
this.setState({isReviewModalOpen: false});
}
},
submitReview: function (rating, review) {
console.log('Submitting rating:' + rating + ', and review:' + review);
this.onCloseReviewButtonPress();
},
render() {
return (
);
}
});
module.exports = ExampleComponent;
```
## Requirements
- Node
## Development
### Installation
```sh
npm install react-native-make-review-modal --save
```
### Roadmap
View the project roadmap [here](https://github.com/djchie/react-native-make-review-modal/issues)
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md) for contribution guidelines.