-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add CreateShoppingList file to components folder #21
Conversation
User able to submit shopping list name which will then show in firebase database and also render on our home page
Visit the preview URL for this PR (updated for commit f6c3934): https://tcl-79-smart-shopping-list--pr21-jo-hm-createlist-hq5pgndh.web.app (expires Sat, 31 Aug 2024 10:38:41 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: d91d9ddbda780208241c52942f544acf8e81407a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done! Love the inclusion of the toast notification! 👏🏾
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Amazing work, just left one non-blocking note.
@@ -17,6 +19,7 @@ export function Home({ data, setListPath }) { | |||
/> | |||
))} | |||
</ul> | |||
<CreateShoppingList user={user} setListPath={setListPath} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love that you created a separate component for the form! It really helps with reusability and keeps the code better organized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Great work guys 🚀
Description
This PR adds a CreateShoppingList component that allows the user to create new shopping lists.
Related Issue
Closes #4
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
feature
Updates
Before
After
Testing Steps / QA Criteria
Do a
git pull
andgit checkout jo-hm-createList
Open the homepage by running
npm start
.Enter a shopping list name into the input box.
Either click 'Create Shopping List' or press the enter key.
App will then automatically navigate to 'List' if the shopping list has been added successfully and a notification will appear telling the user this.
If their has been an error adding the shopping list an error notification will appear asking the user to try again.