1.1.2 • Published 5 years ago

react-native-recommendation v1.1.2

Weekly downloads
6
License
ISC
Repository
github
Last release
5 years ago

React-Native-Recommendation

npm version

Features

  • Net Promoter Score (NPS) view for recommendation and add reviews ( Released :heavy_check_mark: :rocket: )
  • Stars and custom images rating ( Released :heavy_check_mark: :rocket: )

Example

npm.io

Installation

npm i react-native-recommendation or yarn add react-native-recommendation

Usage

import { Recommendation , Rating } from 'react-native-recommendation'
...

 <Rating 
        titleText={"Rating Test"}
        titleStyle={{ alignSelf: 'center', fontWeight: 'bold'}}
        selectedColor={'red'}
        max={5}
        selectedValue={(value)=> // returns selected value } 
        />
        
 <Recommendation 
        titleText={"Recomendation Test"}
        selectedColor={'red'}
        selectedTextColor={'white'}
        unSelectedTextColor={'black'}
        selectedSize={30}
        max={10}
        selectedValue={(value)=> // returns selected value }
        reactionsEnabled // Remove this to disable reaction icon and text
        />

For customized icons and text do as the following

import { Recommendation } from 'react-native-recommendation'
...
// Add NPS reaction description texts in this order
textList=["FROM 9 -> 10","FROM 6 -> 8","FROM 5 -> 4","FROM 2 -> 3","FROM 0 -> 1"]

// Add NPS reaction icons same as text order
emojiList=[
  require('./assets/ic_love.png'),
  require('./assets/ic_happy.png'),
  require('./assets/ic_confused.png'),
  require('./assets/ic_sad.png'),
  require('./assets/ic_angry.png')
]

...

 <Rating 
        titleText={"Rating Test"}
        titleStyle={{ alignSelf: 'center', fontWeight: 'bold'}}
        selectedColor={'red'}
        max={5}
        selectedValue={(value)=> // returns selected value } 
        customSelected={require('./assets/ic_happy.png')}
        customUnSelected={require('./assets/ic_happy.png')} // default value as customSelected prop
        />

 <Recommendation 
        titleText={"Recomendation Test"}
        selectedColor={'red'}
        selectedTextColor={'white'}
        unSelectedTextColor={'black'}
        selectedSize={30}
        max={10}
        selectedValue={(value)=> // returns selected value }
        reactionsEnabled
         // Add these
        reactionTextList={textList}
        reactionList={emojiList}
        />

Components

<Recommendation/>

<Rating/>

Components Props

<Recommendation/>

PropNotesTypeSignature (func)
titleTextRecommendation upper title textString
titleStyleRecommendation text styleStyle
backgroundColorRecommendation view background colorColor
widthRecommendation view width size (full width is recommended)Number
selectedColorSelected option colorColor
selectedTextColorSelected option text colorColor
selectedSizewidth * height sizes and automatic adjust circular shape --- example: 30 means 30 height, 30 width, and 15 border radiusNumber
maxRecommendation option maximum numbers rangeNumber
selectedValueReturned selected valueCallbackselectedValue={ (value) => // your code }
reactionsEnabledAdding smile faces reactions to recommendation (default false)Boolean
reactionTextListSet reaction test relative to user selectionArray of Strings
reactionListSet reaction images relative to user selectionArray of require(images)
disabledRecommendation selecting disabledBoolean
currentValueRecommendation initial valueNumber

<Rating/>

PropNotesTypeSignature (func)
titleTextRating upper title textString
titleStyleRating text styleStyle
backgroundColorRating view background colorColor
widthRating view width sizeNumber
selectedColorSelected icon colorColor
unSelectedColorUnselected icon colorColor
iconStyleRating icon styleStyle
maxRating option maximum numbers rangeNumber
selectedValueReturned selected valueCallbackselectedValue={ (value) => // your code }
customSelectedSet selected customized rating iconrequire(image)
customUnSelectedSet unselected customized rating icon ( customSelected prop is the default valuerequire(image)
disabledRating selecting disabledBoolean
currentValueRating initial valueNumber
1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago