Comments (7)
@salalo one other thing, if I set the isVoted
prop to true, wondering why the percentage values don't show up
Here is my code:
const PollResults = ({ question, handleVote }) => {
const themeData = {
textColor: "#2B355C",
mainColor: "#f3e7fa",
backgroundColor: "#F5F5F7",
alignment: "end",
};
const resData = [
{ id: 0, text: "React", votes: 9 },
{ id: 1, text: "Vue", votes: 7 },
{ id: 2, text: "Angular", votes: 2 },
];
return (
<>
<Text fontWeight="600" fontSize="12px" color="#2B355C" mb="1">
{question}
</Text>
<LeafPoll
type="multiple"
results={resData}
theme={themeData}
onVote={handleVote}
isVoted={true}
isVotedId={1}
/>
</>
);
};
export default PollResults;
from react-leaf-polls.
Hi @asifkabani
Currently there is no support to style individual bars of a poll. You probably could achieve something like this by implementing useRef hook on the fork yourself.
from react-leaf-polls.
@salalo thanks for the information. Is there a way to have number of votes show up for an answer vs the percentage?
from react-leaf-polls.
@asifkabani No, currently there is not but it would be fairly easy to implement, so maybe soon.
from react-leaf-polls.
@asifkabani I've seen that bug but it's pretty irregular, I'll try to replicate and fix it. You can try different version of the package to see if it helps.
from react-leaf-polls.
@salalo I want to see if I can help contribute to this package. Is there a guide I can follow to figure out:
- After I fork, how do I use the forked version
- How do I see the source code to modify and check if it works in my local environment
- submit a PR for the fix
I want to use this package within my application to work on it
from react-leaf-polls.
@asifkabani I've seen that bug but it's pretty irregular, I'll try to replicate and fix it. You can try different version of the package to see if it helps.
I'll take a look at this also and try replicate, think I've seen a similar issue where I use it in prod
from react-leaf-polls.
Related Issues (20)
- Order poll (drag n drop system)
- Create documentation
- NPM and yarn + update documentation
- Fixes
- Code cleanup
- Mouse hovering
- % vlaue animations
- Default style / font built-in
- Export polls separately and remove type prop
- Cover the stuff with tests
- Use ARIA button role
- onVote modification
- Couldn't install on react 17 project HOT 1
- Not allowing me to raise pull request to add some features HOT 1
- Uncaught TypeError: Cannot read properties of undefined HOT 5
- Refactor to make it tree-shakable
- Animation not working when isVotedId is passed HOT 2
- Animations on vote
- Boolean props
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-leaf-polls.