Closed isaabutaa closed 3 years ago
Visit the preview URL for this PR (updated for commit 86a1779):
https://tcl-28-shopping-list--pr21-sd-ia-addnewitem-mj42cymn.web.app
(expires Thu, 29 Jul 2021 00:29:15 GMT)
🔥 via Firebase Hosting GitHub Action 🌎
Should we refactor it so that there is a default selection (and frequency) that is 7, 14, or 30 days?
Following up on this, plus @isaabutaa's suggestion on Slack: "If instead of giving it a default value of 0 or 7, maybe we can have a null default value if it's just a one time purchase. And then if they select another value, it'll swap out the default value."
To start with the simplest solution, I'd suggest making the field required (either by picking one of the existing values as a default for now, or preselecting one of the radio buttons when the form loads). And then you can create an additional issue to improve that behavior later on, if we have time. (That issue will also be a good place to track conversation about possible approaches!)
Great collaboration, team! 💪 🥳
As I was working on adding the id's, I realized we should also add an error handler for when a user submits an empty item input, which we can definitely implement in the future!
As I was working on adding the id's, I realized we should also add an error handler for when a user submits an empty item input, which we can definitely implement in the future!
Good idea, Sandy!
For an example of how to fill this template out, see this Pull Request.
Description
AddItem
component and added a form with an input for the item and frequency for next purchase using radio buttonsitem
,frequency
, andlastPurchasedDate
saved state valueshandleChange
function to save user input values (item name & purchase frequency) to stategetToken()
in auseEffect()
to set token inside localStorage, but we will have to change that after Kelsey and Hulya's PR gets approved and we merge our branches togethername
,frequency
,token
, andlastPurchasedDate
to the item template and added it to the firestore databaseRelated Issue
4
Acceptance Criteria
Type of Changes
Updates
Before
After
Testing Steps / QA Criteria
sd-ia-addnewitem
branchnpm start