@@ -216,18 +216,27 @@ const DrinkTab = (props, context) => {
216216 return (
217217 < Stack vertical >
218218 < Stack . Item >
219- < Section
220- title = "Glass Storage"
221- textAlign = "center" >
222- < GlassRow />
223- </ Section >
224- </ Stack . Item >
225- < Stack . Item >
226- < Section
227- title = "Drink Capacity"
228- textAlign = "center" >
229- < DrinkCapacityRow />
230- </ Section >
219+ < Flex
220+ justify = "center" >
221+ < Flex . Item
222+ grow = { 1 }
223+ mr = { 1 } >
224+ < Section
225+ title = "Glass Storage"
226+ textAlign = "center" >
227+ < GlassRow />
228+ </ Section >
229+ </ Flex . Item >
230+ < Flex . Item
231+ grow = { 1 }
232+ mr = { 1 } >
233+ < Section
234+ title = "Drink Capacity"
235+ textAlign = "center" >
236+ < DrinkCapacityRow />
237+ </ Section >
238+ </ Flex . Item >
239+ </ Flex >
231240 </ Stack . Item >
232241 < Stack . Item >
233242 < Section
@@ -260,7 +269,7 @@ const DrinkTab = (props, context) => {
260269 circular
261270 tooltip = "Reagents to be poured into drinking glasses"
262271 icon = "info" /> } >
263- < MixerDrinkRow />
272+ < MixerDrinkRow1 />
264273 </ Section >
265274 </ Stack . Item >
266275 </ Stack >
@@ -318,7 +327,6 @@ const DrinkTransferRow = (props, context) => {
318327
319328 return (
320329 < Flex
321- align = "center"
322330 justify = "center" >
323331 { dispence_options . map ( amount => (
324332 < Flex . Item
@@ -470,15 +478,17 @@ const MixerDrinkRow = (props, context) => {
470478 </ Table . Cell >
471479 </ Table . Row >
472480 ) ) }
473- < Table . Row
474- align = "center" >
475- < Button
476- fluid
477- content = "Pour glass"
478- textAlign = "center"
479- fontSize = "16px"
480- onClick = { ( ) => act ( "pour" ) }
481- />
481+ < Table . Row
482+ justify = "center" >
483+ < Table . Cell >
484+ < Button
485+ fluid
486+ content = "Pour glass"
487+ textAlign = "center"
488+ fontSize = "16px"
489+ onClick = { ( ) => act ( "pour" ) }
490+ />
491+ </ Table . Cell >
482492 </ Table . Row >
483493 </ Table >
484494 ) ;
@@ -497,3 +507,80 @@ const MixerDrinkRow = (props, context) => {
497507 ) ;
498508 }
499509} ;
510+
511+ const MixerDrinkRow1 = ( props , context ) => {
512+ // Get data from ui_data in backend code
513+ const { act, data } = useBackend < Tab > ( context ) ;
514+ // Get drink information for cart's container from data
515+ const { mixerDrinks = [ ] } = data ;
516+
517+ if ( mixerDrinks . length > 0 ) {
518+ return (
519+ // Create Table for horizontal format
520+ < Flex
521+ direction = "column" >
522+ { /* Use map to create dynamic rows based on the contents of drinks, with drink being the individual item and its stats */ }
523+ { mixerDrinks . map ( reagent => (
524+ // Start row for holding ui elements and given data
525+ < Stack
526+ key = { reagent . drink_name }
527+ justify = "space-around"
528+ fontSize = "14px" >
529+ < Stack . Item
530+ textAlign = "left"
531+ bold >
532+ { /* Get name */ }
533+ { capitalize ( reagent . drink_name ) }
534+ </ Stack . Item >
535+ < Stack . Item >
536+ { /* Get amount of reagent in storage */ }
537+ { reagent . drink_quantity } u
538+ </ Stack . Item >
539+ < Stack . Item >
540+ { /* Make dispense button */ }
541+ < Button
542+ fluid
543+ content = "Transfer Back"
544+ textAlign = "center"
545+ fontSize = "16px"
546+ width = "175px"
547+ // Disable if there is none of the reagent in storage
548+ disabled = { (
549+ reagent . drink_quantity === 0
550+ ) }
551+ onClick = { ( ) => act ( "transferBack" , {
552+ itemPath : reagent . drink_type_path ,
553+ } ) }
554+ />
555+ </ Stack . Item >
556+ </ Stack >
557+ ) ) }
558+ < Table . Row
559+ justify = "center" >
560+ < Table . Cell >
561+ < Button
562+ fluid
563+ content = "Pour glass"
564+ textAlign = "center"
565+ fontSize = "16px"
566+ onClick = { ( ) => act ( "pour" ) }
567+ />
568+ </ Table . Cell >
569+ </ Table . Row >
570+ </ Flex >
571+ ) ;
572+ } else {
573+ return (
574+ < Table >
575+ < Table . Row >
576+ < Table . Cell
577+ fontSize = "14px"
578+ textAlign = "center"
579+ bold >
580+ Mixer Storage Empty
581+ </ Table . Cell >
582+ </ Table . Row >
583+ </ Table >
584+ ) ;
585+ }
586+ }
0 commit comments