Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render shopping list items #16

Merged
merged 4 commits into from
Aug 19, 2024
Merged

Render shopping list items #16

merged 4 commits into from
Aug 19, 2024

Conversation

eva-lng
Copy link
Collaborator

@eva-lng eva-lng commented Aug 15, 2024

For an example of how to fill this template out, see this Pull Request.

Description

SingleList and ListItem components imported into Home and List pages and implemented to render shopping lists and shopping list's items on those pages.

Related Issue

closes #2

Acceptance Criteria

  • The useShoppingLists hook is used in App.jsx to get the shopping lists a user has access to from the database
  • The lists are passed into the Home component as a prop named data
  • The setListPath function is passed into the Home component so we can update the current list
  • The useShoppingListData hook is used in App.jsx to get the items in the current list from the Firestore database
  • The list is passed into the List component as a prop named data
  • In Home.jsx, the SingleList component is used to render the name of each shopping list a user is subscribed to
  • In List.jsx, the ListItem component is used to render the name of each item

Type of Changes

enhancement

Updates

Before

Screenshot 2024-08-15 at 20 51 53

Screenshot 2024-08-15 at 20 51 44

After

Screenshot 2024-08-15 at 20 53 41

Screenshot 2024-08-15 at 20 53 49

Testing Steps / QA Criteria

npm start
Navigate to the browser
Check Homepage to see the rendered shopping
Check the List page to see the rendered shopping list items names

Copy link
Collaborator

@didemydn didemydn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi team :) Thank you
the list page looks fine but I don't see the changes on the home page.
please see the below
image

image

Copy link
Collaborator

@vivitt vivitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job here! Happy to see the app starting to grow 🚀

I left two comments for further improvement. Feel free to address them before merging or reach out if you have any questions.

* so we can see which lists the user has access to.
*/}
{data.map((list, id) => (
<SingleList key={id} name={list.name} />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SingleList component also receives path and setListPath as props. We should pass these props to ensure the list path is correctly stored and can be used to retrieve the list data.

Apart from that, this is very nice code. It's great that you added the key

src/App.jsx Outdated
@@ -38,7 +38,7 @@ export function App() {
* This custom hook takes our token and fetches the data for our list.
* Check ./api/firestore.js for its implementation.
*/
const data = useShoppingListData(listPath);
const data = useShoppingListData('/A45I0SLfsWeHLDg47ETZM5vP8fG2/test-list');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once SingleList receives all the props, we should be able to remove the hardcoded list path and replace it with listPath again.

Copy link

Visit the preview URL for this PR (updated for commit 71e332c):

https://tcl-78-smart-shopping-list--pr16-el-tc-display-list-i-l8rjvk3u.web.app

(expires Mon, 26 Aug 2024 07:45:48 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: c781903507c1507075d7a974036959ddeec29c0a

@Amaka202 Amaka202 merged commit 0c28a76 into main Aug 19, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2. As a user, I want to read all of my shopping lists and the items in them.
5 participants