Open rjwignar opened 6 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated (UTC) |
---|---|---|---|
ai-chef-bot | ✅ Ready (Inspect) | Visit Preview | Apr 15, 2024 9:14pm |
ai-chef-bot-2 | ✅ Ready (Inspect) | Visit Preview | Apr 15, 2024 9:14pm |
I don't know what I'm looking at but I'm glad it fixes things.
@rjwignar
Can you elaborate on this? Or perhaps demonstrate this to me? Thanks.
Can you elaborate on this? Or perhaps demonstrate this to me? Thanks.
I can try to break it down, but I can also give a demonstration this afternoon:
This fixes #205
This is the default onDelete prop passed to Recipe Cards when a RecipeCardList renders recipe cards:
https://github.com/rjwignar/AIChefBot/blob/ada5eb90e860445fb4edb781eed40c06d6130ec2/components/RecipeCardList.js#L28-L36
https://github.com/rjwignar/AIChefBot/blob/b8e28eebeec25a1e1dad3adc22b5f4229344ef98/components/RecipeCardList.js#L54-L60
onHandleDelete() obscures deleted recipes from the RecipeCardList, so the onDelete prop is only used when on the /account/recipes.js:
https://github.com/rjwignar/AIChefBot/blob/b8e28eebeec25a1e1dad3adc22b5f4229344ef98/components/RecipeCard.js#L110-L116
This is useful when a user deletes recipes from their Saved Recipes list. However, recipes.js renders a second RecipeCardList because it also hosts the Generate Similar Recipes use case:
We don't want this RecipeCardList to pass handleOneDelete() to its RecipeCards.
Changes