Untitled

 avatar
user_9363972
typescript
a year ago
1.2 kB
6
Indexable
import {View, Text, Image }from "react-native";
import React from "react";
import {Images }from "../assets/images";
import {styles }from "../styles/style";
const MovieExplanation = (props: any) => {
  const {name, value, isRating, rating }= props;
  return (
    <View style={styles.mainContainerME}>
      <View style={styles.nameContainer}>
        <Text style={styles.generalFontSize}>{name}</Text>
      </View>
      <Text style={styles.generalFontSize}>: </Text>
      <View style={styles.valueContainer}>
        {isRating ? (
          rating === 5 ? (
            <Image style={styles.ratingImage}source={Images.fiveStars}/>
          ) : rating === 4 ? (
            <Image style={styles.ratingImage}source={Images.fourStars}/>
          ) : rating === 3 ? (
            <Image style={styles.ratingImage}source={Images.threeStars}/>
          ) : rating === 2 ? (
            <Image style={styles.ratingImage}source={Images.twoStars}/>
          ) : (
            <Image style={styles.ratingImage}source={Images.star}/>
          )
        ) : (
          <Text style={styles.textValue}>{value}</Text>
        )}
      </View>
    </View>
  );
};
export default MovieExplanation;

Editor is loading...
Leave a Comment