Socket
Socket
Sign inDemoInstall

react-native-make-review-modal

Package Overview
Dependencies
4
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-native-make-review-modal

A React Native component for displaying a modal for making reviews


Version published
Weekly downloads
0
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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
  2. Requirements
  3. Development
    1. Installing Dependencies
    2. Running the Scraper
    3. Handling UCI Data Changes
    4. Roadmap
  4. 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:

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, <MakeReviewModalView
        visible={this.state.isReviewModalOpen}
        isOpen={this.state.isReviewModalOpen}
        onSubmitReview={this.submitReview}
        onCloseReviewButtonPress={this.onCloseReviewButtonPress}
        titleText={'Test Modal'}
      />);
    }
    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 (
      <MakeReviewModalView
        visible={this.state.isReviewModalOpen}
        isOpen={this.state.isReviewModalOpen}
        onSubmitReview={this.submitReview}
        onCloseReviewButtonPress={this.onCloseReviewButtonPress}
        titleText={'Test Modal'}
      />
    );
  }
});

module.exports = ExampleComponent;

Requirements

  • Node

Development

Installation

npm install react-native-make-review-modal --save

Roadmap

View the project roadmap here

Contributing

See CONTRIBUTING.md for contribution guidelines.

Keywords

FAQs

Last updated on 20 Nov 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc