1.0.4 • Published 6 years ago

nativescript-reviews v1.0.4

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
6 years ago

Nativescript Reviews

ready to use reviews box

Install

tns plugin add nativescript-reviews

click here to Download fontawesome-webfont.ttf or download from fontawesome website

  • Place font icon .ttf file in app/fonts, like below:

app/fonts/fontawesome-webfont.ttf

Usage

<UI:Reviews reviews="{{ reviews }}"  />

with more options

<!-- default -->
<UI:Reviews reviews="{{ reviews }}"  />
<!-- reviews with custom date handler  -->
<UI:Reviews dateHandler="arabicDateTime" title="With date handler" reviews="{{ reviews }}" scroll="false" />
<!-- reviews with custom plugin for caching   -->
<UI:Reviews title="Image cache plugins " scroll="false" plugin="{{ plugin }}" imagetag="{{ imagetag }}" reviews="{{ reviewsWithWebImages }}" /> 
<!-- reviews with scroll inside   -->
<UI:Reviews title="Scroll inside" scroll="true" reviews="{{ lotofreviews }}" />

refresh() this function you can triger after you get remote data

let review = getViewById('review'); //you can do remote request or delay review.refresh(); // then refresh your values

see demo for more details

PropertyDefaultDescription
reviewsrequiredArray of reivew object {image: "~/images/icon-50.png", username: "Moayad Najdawi", review: "this is the first review", rate: 5, datetime: new Date(Date.now() - 24 60 60 * 1000)}
scrolltrueenable or disable scrollview inside the reviews holder
showHeadertrueto hide or show review title with the underline style
imagetagthe xml element of the image so you can change it if you need to add cache plugin or something
pluginempty stringplugin include statment like xmlns:IC="nativescript-web-image-cache"
titlereviewsthe title of the reviews box
dateHandlera goyou can change the date text by provide filter inside app resources see app.ts
usereventfire on tap on user image or name return the review object