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

Add CreateShoppingList file to components folder #21

Merged
merged 3 commits into from
Aug 25, 2024

Conversation

joriordan332
Copy link
Collaborator

@joriordan332 joriordan332 commented Aug 22, 2024

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

image

After

image
image

Testing Steps / QA Criteria

  • Do a git pull and git 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.

joriordan332 and others added 2 commits August 20, 2024 21:00
User able to submit shopping list name which will then show in firebase database and also render on our home page
Copy link

github-actions bot commented Aug 22, 2024

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

@joriordan332 joriordan332 changed the title Jo hm create list Add CreateShoppingList file to components folder Aug 22, 2024
Copy link
Collaborator

@marshjaja marshjaja left a 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! 👏🏾

@Hudamabkhoot Hudamabkhoot assigned redapy and unassigned redapy Aug 23, 2024
Copy link
Collaborator

@redapy redapy left a 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.

src/components/CreateShoppingList.jsx Outdated Show resolved Hide resolved
@@ -17,6 +19,7 @@ export function Home({ data, setListPath }) {
/>
))}
</ul>
<CreateShoppingList user={user} setListPath={setListPath} />
Copy link
Collaborator

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.

Copy link
Collaborator

@Wyna-7 Wyna-7 left a 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 🚀

@Hudamabkhoot Hudamabkhoot merged commit 780d659 into main Aug 25, 2024
2 checks passed
@Hudamabkhoot Hudamabkhoot deleted the jo-hm-createList branch August 25, 2024 09:05
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.

4. As a user, I want to set up a new shopping list so I can start tracking purchased items.
5 participants