Coder Social home page Coder Social logo

react-native-wheel-of-fortune's People

Contributors

dependabot[bot] avatar eftalyurtseven avatar joaquinbeceiro avatar rubinjo avatar shamoilarsi avatar

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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-wheel-of-fortune's Issues

Outer and Inner Wheel

How to add Outer and Inner wheel. I don't see any options to add child wheel and push its values separately

Çarkı 2.kez dödüremiyorum.Ve çark üzerinde sayılar gözükmüyor.Kod aşağıda

import React, { Component } from "react";
import {
View,
Text,
StyleSheet,
StatusBar,
Button
} from "react-native";

import WheelOfFortune from 'react-native-wheel-of-fortune';

const rewards = [1,2,3,4,5,6,7,8,9,10]

class App extends Component {

constructor(props) {
super(props);

this.state = {
  winnerValue: null,
  winnerIndex: null
}
this.child = null

}

_renderPlayButton = () => {
return (
TAP TO PLAY
);
}

render() {
return (

<StatusBar barStyle={'light-content'} />
<WheelOfFortune
onRef={ref => (this.child = ref)}
rewards={ rewards }
knobSize={20}
borderWidth={3}
borderColor={"#FFF"}
winner={3}
innerRadius={50}
backgroundColor={"#c0392b"}
getWinner={(value, index) => this.setState({ winnerValue: value, winnerIndex: index })}
/>
<Button title="Press me" onPress={ () => { this.child._onPress() } } />

  </View>
);

}
}
export default App;

const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: 'aquamarine'
},
winner: {
width: '100%',
position: 'absolute',
padding: 10,
backgroundColor: 'black',
bottom: 50,
justifyContent: 'center',
alignItems: 'center'
},
winnerText: {
fontSize: 26,
color: 'black'
},
tapToStart: {
fontSize: 50,
color: '#fff',
fontWeight: 'bold'
}
});

After adding more than 6 rewards to the list wheel order is different. Any solutions ?

If the rewards array contains 6 or else element wheel will show those in the same order and after spinning it will land on the winning index. But if we increase the rewards array list by one (6 + 1) the order on the wheel will be incorrect and after the spin even trough the winning index is the same the wheel will point to a different section since the order is different on the wheel UI it will point to the current order winning index.

Initial Order = ['%10','%20','%30','%40','%50','FREE'];
Wheel Order = ['%10','%20','%30','%40','%50','FREE'];

Initial Order = ['%10','%20','%30','%40','%50','%60','FREE'];
Wheel Order = ['%10','%50','FREE','%60','%40','%20','%30'];

Undefined is not an object

So when downloading the package I got two errors the first one was no problem but they should also fix that which is there no image called 'knob.png' the second error I struggled with:

undefined is not an object (evaluating'_this.props.options.reward)

and I have no idea how to fix it. Any help?

Replace each section by images

Hi,

This is great library, but how can I replace each section in the circle by images. I want to use different images for each sections not just color and numbers.

Thank you in advance.

Rotated Letters have space

If we want to rotate the characters to show them slanting in the center of each portion of wheel, then it shows space after thinner characters because each rendered character takes a fixed width. Is there any way to decrease this space? Decreasing space overlaps the characters.

Align text in each slice

Thinking of doing a PR that allows for text to stand horizontal. At the very moment the text goes down. So what would you like? A prop so people can decide or make it default?

knob.png file does not exist.

When I add this library into my react native app. App shows an error which indicates that in node_modules of this libabrary Image source was imported incorrect with assst name knob.png. while there is demo.png file instead of knob.png

TypeError: _this.props.onRef is not a function

Hi,

I keep getting an eror for: TypeError: _this.props.onRef is not a function

I did a fresh react native project and installed the latest packages of SVG and D3 and receive this error.

index.bundle?platfor…&minify=false:28837 Unhandled JS Exception: TypeError: _this.props.onRef is not a function

This error is located at:
in WheelOfFortune (at App.js:69)
in RCTView (at App.js:68)
in RCTView (at App.js:66)
in App (at renderApplication.js:40)
in RCTView (at AppContainer.js:101)
in RCTView (at AppContainer.js:119)
in AppContainer (at renderApplication.js:39)

"RNSVGSvgView" was not found in the UIManager.

After installation of react-native-wheel-of-fortune package got different errors i.e.. knod.png is not found, RNSVGGroup error.
After isntallation of react-native-svg package got error RNSVGSvgView. Is there any idea about it ?

image

this.props.getWinner is not a function

TypeError: _this.props.getWinner is not a function. (In '_this.props.getWinner(_this._wheelPaths[winnerIndex].value, winnerIndex)', '_this.props.getWinner' is undefined)
at node_modules\expo\build\environment\react-native-logs.fx.js:null in error
at node_modules\react-native\Libraries\Core\ExceptionsManager.js:null in reportException
at node_modules\react-native\Libraries\Core\ExceptionsManager.js:null in handleException
at node_modules\react-native\Libraries\Core\setUpErrorHandling.js:null in handleError
at node_modules\expo-error-recovery\build\ErrorRecovery.fx.js:null in ErrorUtils.setGlobalHandler$argument_0
at node_modules@babel\runtime\helpers\regeneratorRuntime.js:null in tryCatch
at node_modules@babel\runtime\helpers\regeneratorRuntime.js:null in
at node_modules@babel\runtime\helpers\regeneratorRuntime.js:null in tryCatch
at node_modules@babel\runtime\helpers\regeneratorRuntime.js:null in invoke
at node_modules@babel\runtime\helpers\regeneratorRuntime.js:null in PromiseImpl.resolve.then$argument_0
at node_modules\react-native\node_modules\promise\setimmediate\core.js:null in tryCallOne
at node_modules\react-native\node_modules\promise\setimmediate\core.js:null in setImmediate$argument_0
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:null in _allocateCallback$argument_0
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:null in _callTimer
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:null in _callReactNativeMicrotasksPass
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:null in callReactNativeMicrotasks
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:null in __callReactNativeMicrotasks
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:null in __guard$argument_0
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:null in __guard
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:null in flushedQueue

More Information? and RewardList ?

rewards value is only show in string array. not showing int array .
const rewards = ["a", "b","c", "d","d"]

and how to reset wheel when finish one wheel to find winner ?

Fix: knob.png not found

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-wheel-of-fortune/assets/images/knob.png b/node_modules/react-native-wheel-of-fortune/assets/images/knob.png
new file mode 100644
index 0000000..78832cc
Binary files /dev/null and b/node_modules/react-native-wheel-of-fortune/assets/images/knob.png differ

This issue body was partially generated by patch-package.

TypeError: undefined is not an object (evaluating '_this.props.options.rewards')

i have installed this module and applied the example code getting error undefined is not an object (evaluating '_this.props.options.rewards')

const participants = [
'%10',
'%20',
'%30',
'%40',
'%50',
'%60',
'%70',
'%90',
'FREE',
];
const wheelOptions = {
rewards: participants,
knobSize: 50,
borderWidth: 5,
borderColor: '#000',
innerRadius: 50,
duration: 4000,
backgroundColor: 'transparent',
textAngle: 'horizontal',
// knobSource: require('../assets/knob.png'),
getWinner: (value, index) => {
this.setState({winnerValue: value, winnerIndex: index});
},
onRef: ref => (this.child = ref),
};

return (

)

Android - different behaviour when the React Native Debugger is not working

It works well on ios devices but it is not working when the React Native Debugger is not working I attached the screenshots. You can find the rotation of each slice. When I checked the logs, the _wheelPaths lists are the same. How can I fix this error ?

Debug mode off :

Ekran Resmi 2021-11-09 12 34 41

Debug mode on : (expected behaviour)

Ekran Resmi 2021-11-09 12 36 49

Unable to run demo (some kind of casting error?)

abi48_0_0.com.facebool.react.bridge.ReadableNativeArray cannot be cast to abi48_0_0.com.facebool.react.bridge.ReadableMap

I've encountered this error while trying to setup the demo code, as well as in my project, I'm new to react, and this has stumped me, I thought i was making a mistake somewhere, but it seems the demo code does not function either (android and expo)

cheers

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.