0.0.12 • Published 6 years ago

@paraboly/react-native-report-modal v0.0.12

Weekly downloads
10
License
MIT
Repository
github
Last release
6 years ago

Custimazble Report Modal via Paraboly for React Native.

npm version npm Platform - Android and iOS License: MIT styled with prettier

Installation

Add the dependency:

npm i @paraboly/react-native-report-modal

Peer Dependencies

IMPORTANT! You need install them.
"react": ">= 16.x",
"react-native": ">= 0.55.x",
"react-native-vector-icons": ">= 6.x.x",
"@paraboly/react-native-modal-box": ">= x.x.x"

Basic Usage

<ReportModal />

Advanced Usage

<ReportModal
  title="Sorun Bildiriniz"
  buttonText="Gönder"
  iconConfig={IcomoonConfig}
  menuOptions={this.menuOptions}
  onPress={selectedItems => {
    this.onPress(selectedItems);
  }}
/>

Configuration - Props

PropertyTypeDefaultDescription
isOpenbooleanfalseuse this to open modal directly
backdropbooleanfalseuse this to add a backdrop for the modal
titlestringReport Problemchange the title of the modal
buttonTextstringReportchange the button text of the modal
menuOptionsarraycheck the usage sectionset your own data array for the generation of multiple selection bar
refNamestringreportmodaluse this to set the ref of the modal
onPressfunctionnulluse this to handle the onPress of the right bottom button aka send button
iconConfigjsonicomoonuse this to set your own icomoon sets for the icons
modalWidthnumberwidth * 0.75change the modal's width
modalHeightnumber350change the modal's height
dividerWidthnumberwidth * 0.62change the divider's width
titleStylestylecheck the codeset your own style for button
buttonStylestylecheck the codeset your own style for button
buttonTextColorcolorcheck the codechange the button's text color
buttonFontFamilyfont familydefaultset your own font family for the button text
buttonRippleColorcolorcheck the codechange the button's ripple color
buttonShadowColorcolorcheck the codechange the button's shadow color
buttonBackgroundColorcolorcheck the codechange the button's background color
optionFontFamilyfont familydefaultset your own font family for the each option's font family
backgroundColorcolor#a092d6use this to set background color for the header part of the modal
customIconComponentcomponentnulluse this to set your own custom icon component for the generated buttons
onOpenedfunctionnulluse this to set your own onOpened function
onClosedfunctionnulluse this to set your own onClosed function

Generated Menu Options Usage

Okey, Report Modal is able to automatically generate each report menu options to do that we must follow this format. "menuOptions" prop accepts an array and it must be like this : (You can check the example)

menuOptions = [
    {
      id: 0,
      iconSize: 40,
      isSelect: false,
      color: "#b2b6c4",
      text: "Işık Hatası",
      iconName: "feedback_junction_alt1"
    },
    {
      id: 1,
      iconSize: 40,
      isSelect: false,
      color: "#b2b6c4",
      text: "Trafik Kazası",
      iconName: "feedback_accident_alt1"
    },
    {
      id: 2,
      iconSize: 40,
      isSelect: false,
      color: "#b2b6c4",
      text: "Kavşak Arızası",
      iconName: "feedback_light_alt1"
    },
    {
      id: 3,
      iconSize: 40,
      isSelect: false,
      color: "#b2b6c4",
      text: "Yaya Butonu Arızası",
      iconName: "feedback_pedestrian_alt1"
    }
  ];

Author

FreakyCoder, kuray.ogun@paraboly.com || kurayogun@gmail.com

License

React Native Report Modal Library is available under the MIT license. See the LICENSE file for more info.