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

3. As a user, I want to set up a new shopping list so I can start tracking purchased items #3

Closed
6 tasks done
fullybaked opened this issue Mar 25, 2023 · 0 comments · Fixed by #17
Closed
6 tasks done
Assignees

Comments

@fullybaked
Copy link
Contributor

fullybaked commented Mar 25, 2023

Summary

A shopping list is a set of items associated with a specific three-word token. We need to allow users to start new lists, so they can save the things they need to buy. To start a new list, we will need to do a few things:

  1. Generate a new, unique token
  2. Save the token to localStorage
  3. Show the user the list view

Up to this point, the app has rendered the items in the list associated with the token my test list. Before we can allow users to make new lists, we have to stop showing them this test list.

Acceptance criteria

  • @the-collab-lab/shopping-list-utils is added as a dependency to the project.
  • The string my test list in App.jsx is replaced with null, so users are not automatically subscribed to any list.

If a user doesn’t already have a token:

  • A button in the Home component allows them to create a new list
  • Clicking the button generates a new token and saves it to localStorage using the setListToken function in App.jsx.
  • Once the token has been created and saved, the user is redirected to the List view.

If a user does already have a token:

  • They are automatically redirected to the List view.

Notes

  • The generateToken function from the shopping-list-utils package should be used to generate the token. More information on that package its documentation. Importing it will look something like this:
import { generateToken } from '@the-collab-lab/shopping-list-utils';
  • The setListToken function takes one argument: the new list token.
  • Eventually the welcome/home page will look like this wireframe. It’s good for your whole team to look at the wireframe now, but be sure not to try to implement all of the visible functionality at once. There will be future stories to add the other features such as joining an existing list.
  • For this story, it's sufficient just to have a simple "create list" button. Although you are not required to save the token to Firestore, some teams have opted to also save the token to Firestore when generating a token.
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 a pull request may close this issue.

3 participants