VaibhavArora314 / StyleShare

A simple web based platform where users can easily create, explore, and share Tailwind CSS components and designs with fellow users.
https://style-share.vercel.app
MIT License
40 stars 69 forks source link

feat: Added reaction to the post like linkedin in style share successfully Issue 228 reaction #231

Closed MeetDOD closed 3 months ago

MeetDOD commented 3 months ago

Pull Request Resolves [#228 ]

Title: Added reaction to the post like linkedin in style share successfully.

Description

  1. I created a new prisma schema called Reaction and called in User and Post to track their reaction per posts.
  2. With that I created three controller 1st addReactionController to post the reaction, 2nd removeReactionController to delete the reaction and 3rd getReactionsController to get all reaction from posts.
  3. Then I created respective routes, user have to logged in and verified to react on posts.
  4. In frontend, I created a interface IReaction in types.tsx and in PostCard i done fetching and posting the api to update the frontend for the reactions done by the users.
  5. Only one reaction is done by the user, also he/she can choose from 6 six reactions and change anytime.
  6. The design is simple and responsive to all the devices respectively.

Related Issues

Fixes #228

Changes Made

New features: Added reaction to the post like linkedin in style share.

Screenshots:

image

image

image

Video:

https://github.com/VaibhavArora314/StyleShare/assets/120380073/99c0f59e-9048-4620-8930-04a571bf08c6

I certify that I have carried out the relevant code of conduct and provided the requisite screenshot for validation by submitting this pull request.

Thank You for this contribution.

vercel[bot] commented 3 months ago

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated (UTC)
style-share βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Jun 17, 2024 7:29am
github-actions[bot] commented 3 months ago

Thank you for submitting your pull request! πŸ™Œ We'll review it as soon as possible. In the meantime, please ensure that your changes align with our CONTRIBUTING.md. If there are any specific instructions or feedback regarding your PR, we'll provide them here. Thanks again for your contribution! 😊

MeetDOD commented 3 months ago

@VaibhavArora314 Done with this feature, please check and give me feedback about this feature respectively, also give approprite level 1,2,3 because worked on multiple api's and similarly in frotendπŸ˜€

MeetDOD commented 3 months ago

No prob @VaibhavArora314 πŸ‘

VaibhavArora314 commented 3 months ago

I will make this level3 due to the extra work needed to be done to merge with the like/dislike functionality

MeetDOD commented 3 months ago

this is a great feature but I am thinking that this can be integrated with the like functionality. the user can like the post and by default the reaction will be thumbs up. if the user hovers over the like button, other reactions will be shown if the user wants to change it. on the other hand, disliking a post will cause a thumbs down reaction.

and on the post card component, you can show the reactions on the post but user need to open the post to react to it.

@VaibhavArora314 it will be total mess and headache also the reaction api will be wasted and this approach is quite tricky to follow up. hmmm it hard level i have to change many things in front + back end ... I am DEAD πŸ’€

VaibhavArora314 commented 3 months ago

this is a great feature but I am thinking that this can be integrated with the like functionality. the user can like the post and by default the reaction will be thumbs up. if the user hovers over the like button, other reactions will be shown if the user wants to change it. on the other hand, disliking a post will cause a thumbs down reaction. and on the post card component, you can show the reactions on the post but user need to open the post to react to it.

@VaibhavArora314 it will be total mess and headache also the reaction api will be wasted and this approach is quite tricky to follow up. hmmm it hard level i have to change many things in front + back end ... I am DEAD πŸ’€

I know this will be a big headache for u, maybe you can split the work in two pr 1st for the actual functionality on the backend and post integration - level3 2nd for the post card display - level2 I can only think of this way to reward for such a headache πŸ˜…

if its too much work then you can leave it, I will merge the current functionality then

MeetDOD commented 3 months ago

@VaibhavArora314 You asked for it, and now I'm on it. Let's do this! 😀

MeetDOD commented 3 months ago

But what will happen to this PR ?

VaibhavArora314 commented 3 months ago

But what will happen to this PR ?

I am merging this, raise an issue for combining like/dislike with reactions

github-actions[bot] commented 3 months ago

πŸŽ‰ Your pull request has been successfully merged! πŸŽ‰ Thank you for your valuable contribution to our project. Your efforts are greatly appreciated. Feel free to reach out if you have any more contributions or if there's anything else we can assist you with. Keep up the fantastic work! πŸš€