diff --git a/app/logic/constants.R b/app/logic/constants.R index 261ed96..704d202 100644 --- a/app/logic/constants.R +++ b/app/logic/constants.R @@ -10,23 +10,38 @@ GENDERS <- c("male", "female") POPULATIONS <- c("European", "White American", "Black American", "Mexican American", "Asian", "Japanese") #' @export -COFFEE_TYPES <- list( - `Espresso` = list(caffeine = 64, water = 30), - `Americano` = list(caffeine = 77, water = 30), - `Cappuccino` = list(caffeine = 75, water = 180), - `Latte` = list(caffeine = 63, water = 300), - `Mocha` = list(caffeine = 95, water = 240), - `Macchiato` = list(caffeine = 71, water = 30), - `Ristretto` = list(caffeine = 75, water = 22), - `Long Black` = list(caffeine = 77, water = 120), - `Flat White` = list(caffeine = 77, water = 160), - `Affogato` = list(caffeine = 64, water = 30), - `Irish` = list(caffeine = 77, water = 150), - `Turkish` = list(caffeine = 95, water = 240), - `Greek` = list(caffeine = 95, water = 240), - `Vietnamese` = list(caffeine = 77, water = 150), - `Iced` = list(caffeine = 77, water = 150), - `Decaf` = list(caffeine = 2, water = 240) +DRINK_TYPES <- list( + # Coffee types + "Espresso" = list(caffeine = 64, water = 30), # Single shot (30 mL) + "Double Espresso" = list(caffeine = 128, water = 60), # Double shot (60 mL) + "Americano" = list(caffeine = 64, water = 240), # Espresso with water (240 mL) + "Latte" = list(caffeine = 64, water = 240), # Espresso with steamed milk (240 mL) + "Cappuccino" = list(caffeine = 64, water = 180), # Espresso with steamed milk & foam (180 mL) + "Flat White" = list(caffeine = 64, water = 160), # Espresso with steamed milk (160 mL) + "Mocha" = list(caffeine = 64, water = 240), # Espresso with chocolate & milk (240 mL) + "Macchiato" = list(caffeine = 64, water = 45), # Espresso with a dash of milk (45 mL) + "Ristretto" = list(caffeine = 64, water = 15), # Shorter espresso shot (15 mL) + "Lungo" = list(caffeine = 64, water = 60), # Extended espresso shot (60 mL) + "Drip Coffee" = list(caffeine = 95, water = 240), # Standard brew (240 mL) + "Cold Brew" = list(caffeine = 100, water = 240), # Coarse-ground steeped (240 mL) + "Iced Coffee" = list(caffeine = 95, water = 240), # Drip coffee served cold (240 mL) + "French Press" = list(caffeine = 80, water = 240), # Coarse-ground press (240 mL) + "Turkish Coffee" = list(caffeine = 60, water = 60), # Fine-ground simmered (60 mL) + + # Decaf coffee options + "Decaf Espresso" = list(caffeine = 2, water = 30), # Single shot decaf (30 mL) + "Decaf Drip Coffee" = list(caffeine = 5, water = 240), # Standard brew decaf (240 mL) + "Decaf Americano" = list(caffeine = 2, water = 240), # Decaf espresso with water (240 mL) + + # Teas + "Black Tea" = list(caffeine = 47, water = 240), # Steeped black tea (240 mL) + "Green Tea" = list(caffeine = 28, water = 240), # Steeped green tea (240 mL) + "White Tea" = list(caffeine = 15, water = 240), # Steeped white tea (240 mL) + "Oolong Tea" = list(caffeine = 37, water = 240), # Steeped oolong tea (240 mL) + "Matcha" = list(caffeine = 70, water = 60), # Fine powder green tea (60 mL) + "Chai Tea" = list(caffeine = 50, water = 240), # Spiced black tea (240 mL) + "Herbal Tea" = list(caffeine = 0, water = 240), # Herbal infusion (240 mL) + "Rooibos Tea" = list(caffeine = 0, water = 240) # Caffeine-free rooibos (240 mL) ) #' @export diff --git a/app/view/edit_modal.R b/app/view/edit_modal.R index cea974e..602901d 100644 --- a/app/view/edit_modal.R +++ b/app/view/edit_modal.R @@ -7,7 +7,7 @@ box::use( box::use( app/view/react[edit_intake_data, edit_user_data], - app/logic/constants[COFFEE_TYPES, POPULATIONS, METABOLISM, UNITS] + app/logic/constants[DRINK_TYPES, POPULATIONS, METABOLISM, UNITS] ) #' @export @@ -66,7 +66,7 @@ server <- makeModuleServerDestroyable( init_shiny_data = app_data$user_data, ethinicity_options = POPULATIONS, metabolism_options = METABOLISM, - coffee_type_options = COFFEE_TYPES, + coffee_type_options = DRINK_TYPES, unit_options = UNITS ) ) @@ -77,7 +77,7 @@ server <- makeModuleServerDestroyable( edit_intake_data( id = session$ns("edit_intake_data"), init_shiny_data = app_data$intake_data, - coffee_type_options = COFFEE_TYPES + coffee_type_options = DRINK_TYPES ) ) }) diff --git a/app/view/intro_screen.R b/app/view/intro_screen.R index 4c3530f..3f3ebe9 100644 --- a/app/view/intro_screen.R +++ b/app/view/intro_screen.R @@ -3,7 +3,7 @@ box::use( shiny[moduleServer, NS, tagList, observeEvent], ) box::use( - app/logic/constants[COFFEE_TYPES, POPULATIONS, METABOLISM, UNITS], + app/logic/constants[DRINK_TYPES, POPULATIONS, METABOLISM, UNITS], app/view/react[intro_screen_page], # Import the component. ) @@ -16,7 +16,7 @@ ui <- makeModuleUIDestroyable( id = ns("stepper"), ethinicity_options = POPULATIONS, metabolism_options = METABOLISM, - coffee_type_options = COFFEE_TYPES, + coffee_type_options = DRINK_TYPES, unit_options = UNITS, init_shiny_data = list( ethnicity = "European", @@ -30,17 +30,17 @@ ui <- makeModuleUIDestroyable( unit = "metric", intakes = list( list( - type = COFFEE_TYPES["Americano"], + type = DRINK_TYPES["Americano"], time = "08:00", selected = TRUE ), list( - type = COFFEE_TYPES["Latte"], + type = DRINK_TYPES["Latte"], time = "10:00", selected = TRUE ), list( - type = COFFEE_TYPES["Espresso"], + type = DRINK_TYPES["Espresso"], time = "13:30", selected = TRUE )