Now when users click the share post button on either the post actions or the post menu, the post URL gets copied to their clipboard
Additionally, toasts were added to the app to give the user feedback on various actions such as copying links to their clipboard and deleting posts. Toasts can be queued by using the new enqueueToast action. If more than 1 toast is queued at a time, any previous toasts will be immediately dequeued until the latest toast is shown
Changes Made
For sharing posts, we simply used the navigator.clipboard.writeText() function
For toasts, a new slice in the redux store was added along with a global Toast component. This makes it so that we don't have to manually render toasts everywhere; a single toast component in the app is shown or hidden. To queue a toast, simply dispatch the enqueueToast action. There are also few other actions, which the global Toast component uses to manage the toast state and queue under the hood
Besides Nasih's comments, I can't think of anything else. I just need to understand the setToastOpen reducer in the ToastSlice file. This is some good work!
Related Issues
Closes #95 and #124
Summary
Now when users click the share post button on either the post actions or the post menu, the post URL gets copied to their clipboard
Additionally, toasts were added to the app to give the user feedback on various actions such as copying links to their clipboard and deleting posts. Toasts can be queued by using the new
enqueueToast
action. If more than 1 toast is queued at a time, any previous toasts will be immediately dequeued until the latest toast is shownChanges Made
For sharing posts, we simply used the
navigator.clipboard.writeText()
functionFor toasts, a new slice in the redux store was added along with a global
Toast
component. This makes it so that we don't have to manually render toasts everywhere; a single toast component in the app is shown or hidden. To queue a toast, simply dispatch theenqueueToast
action. There are also few other actions, which the globalToast
component uses to manage the toast state and queue under the hoodScreenshots
Testing Instructions
No additional testing instructions
Special Notes for Your Reviewer(s)
No additional notes