diff --git a/src/components/CompactParsedIngredient.vue b/src/components/CompactParsedIngredient.vue new file mode 100644 index 0000000..a1671d0 --- /dev/null +++ b/src/components/CompactParsedIngredient.vue @@ -0,0 +1,76 @@ + + + + + \ No newline at end of file diff --git a/src/components/EditMealPage.vue b/src/components/EditMealPage.vue index b215078..0ef879f 100644 --- a/src/components/EditMealPage.vue +++ b/src/components/EditMealPage.vue @@ -2,20 +2,38 @@
- -
-

Foods

- -
-

Add some recipes

+
+

Recipes

+
    +
  • +

    + +

    + +
  • +
+
+

Add some recipes using the search box

+
+
+ +
+
+
+

Ingredients

+
    +
  • +

    + +

    + +
  • +
+
+

Add some ingredients using the search box

+
+
@@ -26,15 +44,17 @@ import RecipeSearchBox from './RecipeSearchBox.vue'; import RecipeCard from './RecipeCard.vue'; import DatePicker from './DatePicker.vue'; import IngredientAddBox from './IngredientAddBox.vue'; +import IngredientLine from './IngredientLine.vue'; export default { props: ['id'], - components: { RecipeSearchBox, DatePicker, RecipeCard, IngredientAddBox }, + components: { RecipeSearchBox, DatePicker, RecipeCard, IngredientAddBox, IngredientLine }, data() { return { meal: { date: new Date(), - recipes: [{ name: 'Sar Tay' }], + recipes: [], + ingredients: [], chefs: [{ name: 'Ryan' }], consumers: [{ name: 'Ryan' }, { name: 'Jacob' }], } @@ -47,14 +67,20 @@ export default { }, methods: { selectRecipe(recipe) { - this.meal.recipes.unshift(recipe); + this.meal.recipes.push(recipe); }, selectDate(date) { this.meal.date = date; }, removeRecipe(recipe) { this.meal.recipes = this.meal.recipes.filter(r => r.id !== recipe.id); - } + }, + addIngredient(ingredient) { + this.meal.ingredients.push(ingredient); + }, + deleteIngredient(ingredient) { + this.meal.ingredients = this.meal.ingredients.filter(i => i != ingredient); + }, } } @@ -77,6 +103,13 @@ ul { padding: 0; } +.saved-ingredient { + display: flex; + justify-content: space-between; + align-items: center; + margin: 1vh 1em; +} + .saved-recipe { display: flex; justify-content: space-between; @@ -84,15 +117,13 @@ ul { margin: 1vh 1em; } -.saved-recipe button { - background: #fff; - border: 1px solid #ccc; - border-radius: 4px; - padding: 0.5em; - cursor: pointer; - margin: 1em +.saved-ingredient p { + flex: 1; + margin: 0; + margin-right: 1em; } + .saved-recipe button:hover { background: #eee; } diff --git a/src/components/IngredientAddBox.vue b/src/components/IngredientAddBox.vue index 237090f..09a1fd3 100644 --- a/src/components/IngredientAddBox.vue +++ b/src/components/IngredientAddBox.vue @@ -1,9 +1,13 @@ @@ -30,6 +34,7 @@ export default { name: '', quantity: '', unit: '', + link: '' }; }, updateProduct(ingredient, product_link) { @@ -56,4 +61,14 @@ export default { \ No newline at end of file diff --git a/src/components/IngredientLine.vue b/src/components/IngredientLine.vue index cf639d2..1c8a6e8 100644 --- a/src/components/IngredientLine.vue +++ b/src/components/IngredientLine.vue @@ -1,30 +1,11 @@