diff --git a/src/TapRating.tsx b/src/TapRating.tsx index a1a23f2..6ee6a18 100644 --- a/src/TapRating.tsx +++ b/src/TapRating.tsx @@ -2,7 +2,7 @@ import _ from "lodash"; import React, { useState, useEffect } from "react"; -import { StyleSheet, Text, View, StyleProp, ViewStyle } from "react-native"; +import { StyleSheet, Text, View, StyleProp, ViewStyle, TextStyle } from "react-native"; import Star from "./components/Star"; @@ -66,6 +66,13 @@ export type TapRatingProps = { */ ratingContainerStyle?: StyleProp; + /** + * Style for review text + * + * Default is none + */ + reviewTextStyle?: StyleProp; + /** * Callback method when the user finishes rating. Gives you the final rating value as a whole number */ @@ -141,6 +148,12 @@ const TapRating: React.FunctionComponent = props => { ratingContainerStyle.push( props.ratingContainerStyle ); } + const reviewTextStyle = [styles.reviewText, { fontSize: reviewSize, color: reviewColor }]; + + if ( props.reviewTextStyle ) { + reviewTextStyle.push( props.reviewTextStyle ); + } + _.times( count, index => { rating_array.push( = props => { return ( {showRating && - + {reviews[position - 1]} }