DevTalent1121 / sapien-eleven-master

0 stars 0 forks source link

Issues by the weekend #1

Closed DevTalent1121 closed 2 years ago

DevTalent1121 commented 2 years ago

On this health website bettertx.com they have this interactive graph that compares healthcare costs vs number of diagnosis for 4 conditions. Is there anyway to do this or integrate this into the website? 1 I’d like the graph after "Chronic Disease" facts with the same background.

ndev1991 commented 2 years ago

Thanks. i think the first task already done? Not sure, but need improvement for the first issue let me know. And the second one, need to implement the chart or need information for the chart? https://recharts.org/en-US/examples/CustomActiveShapePieChart Here is information for recharts. Please let me know what issue need to be resolved. Thanks

ndev1991 commented 2 years ago

@DevTalent1121

DevTalent1121 commented 2 years ago

@ndev1991 The first issue is not completed yet. Are you able to run the npm on your pc? Please have a look at the file - src\pages\landing-page\Banner.tsx I was going to perform bubble's moving down action using offset. But the useEffect is not called on scrolling. Please keep me update when you have checked the code. Thanks

ndev1991 commented 2 years ago

@DevTalent1121 Eventually it's not a window that scroll works for scroll. It's happening on body

const onScroll: any = () => { console.log('--aa', window.pageYOffset) setOffset(window.pageYOffset); return true; }

useEffect(() => {
    document.body.addEventListener('scroll', onScroll, true);
  return document.body.removeEventListener('scroll', onScroll);
}, []);

So you need to do this. Like useEffect(() with empty [] as dependency is onmount and called only once. There we can add eventlistener for onscroll and then can remove that eventlistener when unmounted as you can see above.

Let me know if you have any further thing.

DevTalent1121 commented 2 years ago

That works for me. Thanks!

ndev1991 commented 2 years ago

Cool. If you have more issues just assign new issues @DevTalent1121