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

Mp sm create new shopping list #22

Merged
merged 6 commits into from
Aug 25, 2024
Merged

Conversation

sar-mko
Copy link
Collaborator

@sar-mko sar-mko commented Aug 22, 2024

Description

  • Changed Home.jsx to display a form for users to add new lists. Lists get saved to local storage, and then users get redirected to the list page.
  • In firebase.js added a return to the createList function, in order to pass the list path into the setListPath hook. In Home.jsx setListPath function takes path and saves it to database and local storage.
  • Got great practice working with local storage, and working our way back to find where the path was and debugging to then add the return in firebase.js
  • Layout.jsx - fixed a duplicate import

Related Issue

Acceptance Criteria

UI-related tasks:

  • The Home view displays a form that allows users to enter the name of a shopping list and then create a list with that name.
  • The input that accepts the name of the item has a semantic label element associated with it
  • The user can submit this form with both the mouse and the Enter key
  • When the user submits the form, they see a message indicating that the list either was or was not created and saved to the database.

Data-related tasks:

  • Clicking the button uses the createList function in src/api/firebase.js to create a new shopping list for the user.
  • The shopping list path is stored in local storage using the setListPath function.
  • Once the list has been created and saved, the user is redirected to the List view.

Type of Changes

  • Bug fix
  • New feature

Updates

Testing Steps / QA Criteria

  • Log in, add a list name into form, click submit/press Enter
  • Should add to local storage, and will redirect to the List page
  • Testing Error: In Home.jsx at the handleSubmit function, Add "throw new Error" to check error message

sar-mko and others added 3 commits August 21, 2024 09:46
…to creatList function. Implemented saving the list to local storage and having the user be redirected to the listpage.
Copy link

github-actions bot commented Aug 22, 2024

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

https://tcl-76-smart-shopping-list--pr22-mp-sm-create-new-sho-2lg5igqc.web.app

(expires Sun, 01 Sep 2024 17:32:45 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 512b1a88be8ae05fd3e727b99332819df760271d

src/api/firebase.js Outdated Show resolved Hide resolved
Copy link
Member

@mindyzwan mindyzwan left a comment

Choose a reason for hiding this comment

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

Looks good! One non-blocking nitpick, but merge away!

Co-authored-by: Mindy Zwanziger <[email protected]>
@sar-mko sar-mko merged commit 819d758 into main Aug 25, 2024
2 checks passed
@mentalcaries mentalcaries deleted the mp-sm-create-new-shopping-list branch August 30, 2024 00:08
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.

5 participants