liinnjohansson / todays-lunch

0 stars 1 forks source link

33 implement toggle function on like button #36

Closed liinnjohansson closed 3 years ago

liinnjohansson commented 3 years ago

close #33

Default state for likedBistros is an empty array. State fills (and empties) with liked restaurants if the heart button is pressed. Default state for the heart is outlined and will be toggled between that and filled when pressed.

State and toggle function is situated in BistroContext.

After consultation with David I have removed likedBistro-bool from interface and objects in bistroData.ts. It isn't the restaurant that should know if it is liked or not, the knowledge belongs to the user. A userContext would be great to have (in a fully developed app), but is not neccessary now. Just a thought from David.

MIND THIS: Added an issue for connecting and saving liked bistros to something similar to Local Storage (Secure Store). It is in other words not implementet in this issue/branch.

heartfunction