EdgarQuinonez / nufogy-expo-app

Front-End de Nufogy con Expo.
0 stars 0 forks source link

Pantalla de visualizacion de ingredientes #2

Closed pedroelfire closed 3 months ago

pedroelfire commented 4 months ago

Este debera ser un componente que pueda ser reutilizable en varias pantallas, este componente debera recibir una id de fatsecret, y una id de la base de dato Diary (este es opcional) si se recibe, se deberan cargar los datos ya registrados del usuario, al recibir la id de fatsecret se realizara una busqueda del ingrediente respectivo en la api, tambien se hara un get de los MealTypes del usuario

Barra superior:

Una grafica de dona:

Manejo del ingrediente: -Esta sección te permitirá elegir entre los tipos de raciones de la comida y la cantidad -El tipo de ración deberá ser un dropdown, este dropdown se deberá cargar con los tipos de raciones que regrese fatsecret -La cantidad debera ser un input flotante, que no permita el teclado normal, solo el de numeros -Un campo de calendario que permita elegir el dia para registrar -Un campo que permita seleccionar la comida del dia en el que se va a guardar (MealTypes)

Para los botones y inputs usar el color :

#1E1940

Para las búsquedas en la api:

  1. Obtener los tipos de comida del usuario:
https://nufogy-api.fly.dev/diary/mealtypes
Response: 
{
        "user": 23,
        "id": 5,
        "name": "Desayuno"
    },
    {
        "user": 23,
        "id": 6,
        "name": "Comida"
    },
    {
        "user": 23,
        "id": 7,
        "name": "Cena"
    },
    {
        "user": 23,
        "id": 8,
        "name": "Colacion 1"
    },
    {
        "user": 23,
        "id": 9,
        "name": "Colacion 2"
    }

2-Obtener un ingrediente de fatsecret:

http://nufogy-api.fly.dev/diary/fs/getingridient/5050
Response: 
{
    "message": "Search Successful",
    "data": {
        "food_id": "5050",
        "food_name": "Meatless Lo Mein",
        "food_type": "Generic",
        "food_url": "https://www.fatsecret.com/calories-nutrition/generic/lo-mein-meatless",
        "servings": {
            "serving": [
                {
                    "calcium": "36",
                    "calories": "254",
                    "carbohydrate": "40.88",
                    "cholesterol": "0",
                    "fat": "6.36",
                    "fiber": "3.4",
                    "iron": "2.10",
                    "measurement_description": "cup",
                    "metric_serving_amount": "200.000",
                    "metric_serving_unit": "g",
                    "monounsaturated_fat": "2.512",
                    "number_of_units": "1.000",
                    "polyunsaturated_fat": "2.078",
                    "potassium": "280",
                    "protein": "8.88",
                    "saturated_fat": "1.104",
                    "serving_description": "1 cup",
                    "serving_id": "17063",
                    "serving_url": "https://www.fatsecret.com/calories-nutrition/generic/lo-mein-meatless?portionid=17063&portionamount=1.000",
                    "sodium": "360",
                    "sugar": "2.76",
                    "vitamin_a": "26",
                    "vitamin_c": "6.8"
                },
                {
                    "calcium": "18",
                    "calories": "127",
                    "carbohydrate": "20.44",
                    "cholesterol": "0",
                    "fat": "3.18",
                    "fiber": "1.7",
                    "iron": "1.05",
                    "measurement_description": "g",
                    "metric_serving_amount": "100.000",
                    "metric_serving_unit": "g",
                    "monounsaturated_fat": "1.256",
                    "number_of_units": "100.000",
                    "polyunsaturated_fat": "1.039",
                    "potassium": "140",
                    "protein": "4.44",
                    "saturated_fat": "0.552",
                    "serving_description": "100 g",
                    "serving_id": "53730",
                    "serving_url": "https://www.fatsecret.com/calories-nutrition/generic/lo-mein-meatless?portionid=53730&portionamount=100.000",
                    "sodium": "180",
                    "sugar": "1.38",
                    "vitamin_a": "13",
                    "vitamin_c": "3.4"
                },
                {
                    "calcium": "5",
                    "calories": "36",
                    "carbohydrate": "5.79",
                    "cholesterol": "0",
                    "fat": "0.90",
                    "fiber": "0.5",
                    "iron": "0.30",
                    "measurement_description": "oz",
                    "metric_serving_amount": "28.350",
                    "metric_serving_unit": "g",
                    "monounsaturated_fat": "0.356",
                    "number_of_units": "1.000",
                    "polyunsaturated_fat": "0.295",
                    "potassium": "40",
                    "protein": "1.26",
                    "saturated_fat": "0.156",
                    "serving_description": "1 oz",
                    "serving_id": "182964",
                    "serving_url": "https://www.fatsecret.com/calories-nutrition/generic/lo-mein-meatless?portionid=182964&portionamount=1.000",
                    "sodium": "51",
                    "sugar": "0.39",
                    "vitamin_a": "4",
                    "vitamin_c": "1.0"
                },
                {
                    "calcium": "36",
                    "calories": "254",
                    "carbohydrate": "40.88",
                    "cholesterol": "0",
                    "fat": "6.36",
                    "fiber": "3.4",
                    "iron": "2.10",
                    "measurement_description": "serving (200g)",
                    "metric_serving_amount": "200.000",
                    "metric_serving_unit": "g",
                    "monounsaturated_fat": "2.512",
                    "number_of_units": "1.000",
                    "polyunsaturated_fat": "2.078",
                    "potassium": "280",
                    "protein": "8.88",
                    "saturated_fat": "1.104",
                    "serving_description": "1 serving (200 g)",
                    "serving_id": "18714",
                    "serving_url": "https://www.fatsecret.com/calories-nutrition/generic/lo-mein-meatless?portionid=18714&portionamount=1.000",
                    "sodium": "360",
                    "sugar": "2.76",
                    "vitamin_a": "26",
                    "vitamin_c": "6.8"
                }
            ]
        }
    }
}
EdgarQuinonez commented 3 months ago

Listoo