-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add toasts #23
feat: add toasts #23
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, @alefDev-prog . This issue could be definitely cause by this.
However, before anything. I'd like to focus on implementing the toasts following: https://ui.shadcn.com/docs/components/toast
We can use the manual installation and copy the entire implementation, just make sure to adapt and use TailwindCSS colors.
This is the main AC from this issue. Once we've implemented the toasts to fit the UI we can then figure out what refactoring do we need in the component itself.
Since it is a bit of refactoring needed, I can take over this one if you'd need. I'm not happy with react-toastify
package because we're using Radix for the most part and it falls outside of the UI aesthetic.
Hi, ok sure I use your prefered package instead. |
We're heavily inspiring our look from that library so that's why I'm pushing for consistency. Sorry, I appreciate your help. It's just going to make it easier for all of us. @alefDev-prog |
feat: added toasts feat: added toasts without styling feat: added toast without styling
Hi, I understand that you want consistency. I have now included the package you wanted and I have set it up so that the toast gets presented to the user on fail or success. However, as I am not very experienced in Tailwind css I will leave the styling for someone else to do. |
@alefDev-prog good work here! Unfortunately, I cannot collaborate in this PR because you didn't use a branch and are working off main. In the future to ensure collaboration please from your forked repository open a branch.
|
fixes #10
Affected files:
What I have done:
ToastContainer
in page.tsxIssue I have encountered:
I have encountered an issue in src/components/ClipboardImage.tsx. The component in this file re-renders multiple times when clicking on the picture in the frame. This causes the
pasteImage
function to be called multiple times, resulting in several toasts apperaing on a single click. I think that the issue is with theimageCallback
function and how it uses theuseCallback
hook. The items in its dependency-array are being changed within the function itself, something I think causes this issue.I have tried to solve this issue without changing the
useCallback
hook but without success. As I wrote before, this results in multiple toasts appearing on a single click.