Skip to main content

A similar question has been posted by another user about 3 years ago, but they didn’t have a solution on their post.

I am trying to get the “like” button to return to its default state when the “dislike” button is clicked and vice versa.

When hovered over, they reveal a tool tip and turn gray.

Each time one of these buttons is clicked, it shows a different notification overlay (liked notif, disliked notif, and undo notif (undo happens on 2nd click)).

Below is the current logic I am trying for the “like” button (I’ve tried a few variations, I’ve asked AI, and I’ve tried different variables. I’ve also tried having both buttons in the same component set).

If you have any ideas at all, please advise. I will try those too. 😅

Thank you in advance!

 

Can you show your props?


Can you show your props?

Hi Raphael - Below shows the current props of the separated components, as well as the option that contains both like/dislike button in a set.

 


Hi Adunny,

 

I’ll show you two ways to do that:

  1. Making a group button (easiest but not your setup though)
    You just need to make a button group component with both like and dislike.
  2. Individual button + variables (somehow your setup)
    Create 2 variables that would control the active state of the like and dislike button and then use conditional logic for the actions.

Reply