Giter VIP home page Giter VIP logo

react-native-stars's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-stars's Issues

stars can't show stars in iOS 14

Image cannot show image in iOS 14, but can show location, like:
<Stars
default={0}
opacity={true}
count={5}
starSize={32}
update={val => {
this.starState(val);
this.setState({ starVal: val });
}}
spacing={8}
disabled={false}
half={false}
fullStar={require('App/Assets/Images/Place/starOn.png')}
emptyStar={require('App/Assets/Images/Place/starOff.png')}
halfStar={require('App/Assets/Images/Place/starHalf.png')}
/>

Environment:
Xcode Version 12.0 (12A7209)
Simulator: IPhone 11 - 14.0
"react-native": "0.62.2"

Partial value is not rendered correctly

Hello,

I want to use this library in replacement to SVG rendering on my app (due to performance issue when rendering many SVGs). I have found that partial values are not displayed correctly.

This is the display I would get for a 4.4 / 5 rating :

Capture d’écran 2020-03-13 à 15 02 40

And here is what the component looks like :

Capture d’écran 2020-03-13 à 15 04 09

I guess it has to do with react-native version or some styling issue, I will try to debug it.

Here are my system informations from react-native info

System:
    OS: macOS 10.15.3
    CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
    Memory: 2.66 GB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 11.14.0 - /var/folders/6f/g_r7mj015c55ch_5vx9r0rkc0000gn/T/yarn--1584108282406-0.2228863223045563/node
    Yarn: 1.15.2 - /var/folders/6f/g_r7mj015c55ch_5vx9r0rkc0000gn/T/yarn--1584108282406-0.2228863223045563/yarn
    npm: 6.12.0 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.0, DriverKit 19.0, macOS 10.15, tvOS 13.0, watchOS 6.0
    Android SDK:
      API Levels: 23, 25, 26, 27, 28
      Build Tools: 23.0.1, 25.0.0, 25.0.2, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.0, 28.0.2, 28.0.3
      System Images: android-27 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom
  IDEs:
    Android Studio: 3.4 AI-183.6156.11.34.5522156
    Xcode: 11.0/11A419c - /usr/bin/xcodebuild
  npmPackages:
    react: 16.9.0 => 16.9.0 
    react-native: 0.60.6 => 0.60.6 
  npmGlobalPackages:
    react-native-cli: 2.0.1
✨  Done in 183.79s.

How to get event when start value change

Hi there

I need to call api when the star value gets changes

So is there any event method which called when star value gets changes Like onChange op selectedStar etc

Please let me know

Thanks

Stars are Wrong

Hello,

I have the current code:
<View style={{ alignItems:'center' }} > <Stars value={1} spacing={8} count={5} starSize={40} backingColor='transparent' fullStar={require('../../images/fullstar.png')} emptyStar={require('../../images/emptystar.png')} halfStar={require('../../images/halfstar.png')} /> </View> </View>

but when I have a value of 1, it shows 2 stars. Same happens for any values put in

Fix published npm version

The current version of the package npm looks like it has a rogue typescript file included. This causes issues with type checking locally because it's automatically pulled in as a source file. Can this be republished with the index.ts file?

image

Unable to make 0 ratings

I make use of this library and found that I can't make 0 rating after setting 1 or half of rating.
And one more thing is there any way to set default rating as 1 later user won't able to make 0.5 rating.
Can anyone please help me out?

StarRating won't change size

Hello,

I am using the custom version for the star rating and it's not letting me change the size even though I have set it to starSize={50} Here's what I have set to:

<StarRating
            default={2.5}         
            count={5}
            half={true}
            starSize={50} 
            fullStar={<Icon name={'star'} style={[styles.myStarStyle]}/>}
            emptyStar={<Icon name={'star-outline'} style={[styles.myStarStyle, styles.myEmptyStarStyle]}/>}
            halfStar={<Icon name={'star-half'} style={[styles.myStarStyle]}/>}
         />

image0

Support for Expo icons

It would be great if this library supported expo vector icons in addition to images.

import MaterialIcons from '@expo/vector-icons';

<Stars
   fullStar={<MaterialIcons name='star' />}
/>

on Android wrong number of starts are displayed

Hey there,
I calculate the number of starts by adding 2 values and splitting it, and i log the value, it is correct, but when i pass it to the star's value property and display it it shows always 1 more star.
for example (1+5)/2 =3 right but it displays 4 stars
here is my star component:

<Stars
      value={props.data.rating}
      half={props.half}
      spacing={8}
      count={5}
      starSize={50}
      backingColor="transparent"
      fullStar={require("./../icons/filled-heart.png")}
      emptyStar={require("./../icons/empty-heart.png")}
      halfStar={require("./../icons/half-heart.png")}
    />

also it does the same if i just put in a number for value

display mode allows editing

Hey there I made a component to display rating but it allows me to edit the rating, if I click on any of the icons
my code:

<View style={styles.container}>
    <Text style={styles.border}>★・・・・・・★・・・・・・★・・・・・・★</Text>
    <Text style={styles.text}>{props.data.name}</Text>
    <Stars
      half={props.half}
      rating= {props.data.rating}
      spacing={8}
      count={5}
      starSize={50}
      backingColor='transparent'
      fullStar={require('./../icons/filled-heart.png')}
      emptyStar={require('./../icons/empty-heart.png')}
      halfStar={require('./../icons/half-heart.png')}
    />
  </View>

Why is that the case?

Half star not working for display

Hi, just tried using the stars component to display some stars and the half star is working for the selection but not display. Any help, suggestion on whats going on?

            <Stars
              value={4.5}
              spacing={0.8}
              half={true}
              count={5}
              starSize={20}
              backingColor="cornsilk"
              halfStar={require('../../assets/icons/star_half.png')}
              fullStar={require('../../assets/icons/star_filled.png')}
              emptyStar={require('../../assets/icons/star_empty.png')}/>

Cannot Set Value for display props

I am following the documentation to display partial rating, but display props throw errors when i pass the rating state into it.

The error message is as follows:

Json.stringify cannot serialize cyclic structure.

Any solution to solve this issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.