FiveStarView.js 983 Bytes
import React, {Component} from 'react';
import {
    View,
    Text,
    Image,
} from 'react-native';

export default class FiveStarView extends Component {

    constructor(props) {
        super(props);
    }

    render() {
        return(
			<View 
				style={[{height:25/zoomW,width:width,flexDirection:'row',
				justifyContent:'flex-start',alignItems:'center'}]}
			>
				{starMap.map((item,loop)=>{
					return (
						<TouchableWithoutFeedback key={loop} onPress={()=>NoDoublePress.onPress(()=>{
							this.props.data.star = loop+1;
							this.data = loop+1;
						})}>
							<Image source={this.props.data.star > loop?require('./imgs/star_on.png'):
								require('./imgs/star_off.png')} style={{height: 20/zoomW,width: 20/zoomW,marginRight: 8/zoomW}} resizeMode={"contain"}/>
						</TouchableWithoutFeedback>
					)
				})}
				<Text style={{fontSize:setSpText2(12),color:'#999999'}}>
					{this.logic.getStarStr(this.data)}
				</Text>
		</View>
        )
    }


}