web3uikit icon indicating copy to clipboard operation
web3uikit copied to clipboard

dispatch function from useNotification is not working correctly

Open sadityakumar9211 opened this issue 3 years ago • 4 comments

I have used the useNotification() hook for notifications. The notification position is not working correctly in the deployed application. https://medichain.vercel.app/ The Github repository of this deployed site is: https://github.com/sadityakumar9211/medichain-nextjs

In the localhost, it is coming in the correct position in the bottom-right, but in the deployed file, it is coming on top of the header and shifting all the content down for the time it remains there.

sadityakumar9211 avatar Aug 07 '22 22:08 sadityakumar9211

has nothing to do with the uikit itself, you have to setup styled components to work with next js. you can follow this repo next js styled components

ghost avatar Aug 08 '22 06:08 ghost

Hey @iuliannov I am not getting how using the styled component will help resolve my issue. Can you please explain a little more.

sadityakumar9211 avatar Aug 08 '22 18:08 sadityakumar9211

The components from web3uikit are built with styled-components, which doesnt work out of the box with nextjs. You have to setup nextjs to support styled-components so you can build your app successfully. Its easy to do, check next.config.js and _document.tsx. These are the only thing you have to add to make it work

ghost avatar Aug 09 '22 13:08 ghost

@sadityakumar9211 let us know if this fixes the issue. TY for using the kit 😄

TY @iuliannov for your help 🙌🏻

AbhinavMV avatar Aug 10 '22 18:08 AbhinavMV

Hey @sadityakumar9211 I am closing the issue since one of our community members was able to solve this same issue by the above solution by @iuliannov 🥳 Ping us on moralis web3uikit channel on discord if you are still facing this issue 🙌🏻 TY for using the kit 😄

AbhinavMV avatar Sep 04 '22 17:09 AbhinavMV