1.0.4 • Published 3 years ago

react-native-reviews v1.0.4

Weekly downloads
99
License
MIT
Repository
github
Last release
3 years ago

React Native Reviews

React Native Reviews is a highly customizable component with no dependencies meant to be used to to propmt your users to review your app. This is not a modal component. It's just a presentational component you can use on top of your preferred modal component.

Initial Dialog Positive Feedback Dialog Negative Feedback Dialog

Installation

Use your prefered package manager

npm install react-native-reviews

Usage

Given that React Native Modalfy uses the new React Context & Hooks APIs added respectively in React 16.3.0 and React 16.8.0, we'll require you to use at least react-native@^0.59.0(that ships with React 16.8.3).

import React, {useCallback} from 'react';
import {Modal} from 'react-native';
import Rate from 'react-native-reviews';

const RateModal = React.memo(function RateModal({modal}) {
  const onSubmit = useCallback(feedback => {
    //process feedback
  }, []);

  return (
    <Modal {...modalProps}>
      <Rate onDimiss={() => modal?.closeModal()} onSubmit={onSubmit} />
    </Modal>
  );
});

export {RateModal};
PropDescriptionRequiredDefault Value
androidPackageNameString: used to take the users to your Google store page.
buttonStyleStyles: use this to customize the button styles
buttonTextStyleStyles: use this to customize the text component within buttons
containerStylesStyles: use this to customize the main component styles
dislikeIconSourceImage Source: use this to set your own dislike icon
dislikeIconSourceSelectedImage Source: use this to set your own dislike icon when selected
dismissButtonTextString: use this to change the default textDISMISS
helperTextDislikeString: use this to change the default default helper text when the dislike option is selectedPlease help us understand what could be improved.
helperTextLikeString: use this to change the default default helper text when the like option is selectedWould you be willing to leave a review in the app store?
helperTextStylesStyles: use this to customize the helper text styles
iOSStoreIdString: used to take the users to your app's iOS store page
inputContainerStylesStyles: use this to customize the input container (example: adding margins)
inputPlaceholderString: use this to change the input placeholder
inputPropsText Input Props: use this to change any of the TextInput props
likeIconSourceImage Source: use this to set your own like icon
likeIconSourceSelectedImage Source: use this to set your own like icon when selected
mainTitleString: use this to change the main titleHow do you like the app?
mainTitleStyleStyles: use this to customize the main title styles
onDimissPressFunction: use this to handle the DISMISS button onPress event (example: closing the modal)yes
onReviewPressFunction: use this to handle the DISMISS button onPress event (example: closing the modal)
onReviewPressFunction: use this to change how to handle the review button onPress event (example: not taking the user to the stores)
onSubmitPressFunction: use this to handle the SUBMIT button onPress event. Receives a string which represents the feedback from the user. (example: sending the feedback to the server)yes
renderDislikeIconFunction: use this to render your own dislike icon (example: using vector icons). Receives a "isSelected" param.
renderInputFunction: use this to render your own TextInput component (example: using a material-based component)
renderLikeIconFunction: use this to render your own like icon (example: using vector icons). Receives a "isSelected" param.
reviewButtonTextString: use this to change the YES, REVIEW IT button text
submitButtonTextString: use this to change the SUBMIT button text
subtitleDislikeString: use this to change the default subtitle when the dislike option is selectedSorry to hear that.
subtitleLikeString: use this to change the default subtitle when the like option is selectedThat's good to hear!
subtitleStylesStyles: use this to customize the subtitle text styles

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT License

Copyright (c) 2020 FullStack Labs

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.