Add the ability to save photos to a Favorites library, persist them using local storage, and provide a UI for managing Favorites. This functionality applies to both the infinite scrolling grid and a dedicated Favorites page.
Tasks:
[x] Create a Favorites service:
Add methods for addToFavorites, removeFromFavorites, and getFavorites.
Use local storage for persistence.
[x] Add "Add to Favorites" button to the photo-grid component.
Toggle the button state based on Favorites status.
[x] Implement a favorites.component.ts to display saved photos.
Include a button to remove photos from Favorites.
[x] Ensure Favorites persist after a page refresh using local storage.
[x] Highlight photos already in Favorites in the photo-grid component.
[x] Write unit tests for Favorites functionality:
Adding/removing Favorites.
Retrieving data from local storage.
Verifying UI states for Favorites.
Acceptance Criteria:
Users can add/remove photos to/from Favorites.
Favorites persist across page reloads.
The Favorites library displays all saved photos with a remove button.
Add the ability to save photos to a Favorites library, persist them using local storage, and provide a UI for managing Favorites. This functionality applies to both the infinite scrolling grid and a dedicated Favorites page.
Tasks:
[x] Create a Favorites service:
addToFavorites
,removeFromFavorites
, andgetFavorites
.[x] Add "Add to Favorites" button to the
photo-grid
component.[x] Implement a
favorites.component.ts
to display saved photos.[x] Ensure Favorites persist after a page refresh using local storage.
[x] Highlight photos already in Favorites in the
photo-grid
component.[x] Write unit tests for Favorites functionality:
Acceptance Criteria: