@@ -148,6 +148,7 @@ const SortableGroupItem: React.FC<SortableGroupItemProps> = ({
148148 iconName = { item . icon || '' }
149149 showLabel = { true }
150150 editMode = { isEditing }
151+ size = { itemSize }
151152 config = { {
152153 isWol : item . isWol ,
153154 macAddress : item . macAddress ,
@@ -262,7 +263,7 @@ const GroupWidget: React.FC<GroupWidgetProps> = ({
262263 // 4x2 grid layout (8 items in 2 rows of 4 items each)
263264 return {
264265 width : '22%' , // Even narrower items, 4 per row
265- maxWidth : '120px ' , // Max width for larger screens
266+ maxWidth : '180px ' , // Max width for larger screens
266267 rows : 2 ,
267268 cols : 4 ,
268269 height : DUAL_WIDGET_CONTAINER_HEIGHT ,
@@ -473,14 +474,6 @@ const GroupWidget: React.FC<GroupWidgetProps> = ({
473474 }
474475 } , [ items , onItemsChange , onItemDelete ] ) ;
475476
476- // Handle click on add button - opens the group edit modal
477- const handleAddClick = useCallback ( ( ) => {
478- if ( isEditing && items . length < MAX_ITEMS ) {
479- // Open the group edit modal
480- onEdit ?.( ) ;
481- }
482- } , [ isEditing , items . length , onEdit , MAX_ITEMS ] ) ;
483-
484477 // Cleanup effects for mobile
485478 useEffect ( ( ) => {
486479 // Cleanup function to ensure we don't leave lingering event listeners
@@ -650,16 +643,22 @@ const GroupWidget: React.FC<GroupWidgetProps> = ({
650643 sx = { {
651644 flex : 1 ,
652645 display : 'grid' ,
653- gridTemplateColumns : layout === '2x3' ? 'repeat(2, minmax(100px, 160px))' : layout === '4x2' ? 'repeat(4, minmax(70px, 115px))' : 'repeat(3, minmax(90px, 150px))' ,
654- gridTemplateRows : layout === '2x3' ? 'repeat(3, 1fr)' : 'repeat(2, 1fr)' ,
655- gap : 3 ,
646+ gridTemplateColumns : layout === '2x3'
647+ ? { xs : 'repeat(2, minmax(110px, 180px))' , sm : 'repeat(2, minmax(90px, 160px))' }
648+ : layout === '4x2'
649+ ? { xs : 'repeat(4, minmax(70px, 110px))' , sm : 'repeat(4, minmax(75px, 140px))' , md : 'repeat(4, minmax(85px, 160px))' , lg : 'repeat(4, minmax(95px, 180px))' }
650+ : { xs : 'repeat(3, minmax(95px, 160px))' , sm : 'repeat(3, minmax(85px, 150px))' } ,
651+ gridTemplateRows : layout === '2x3' ? 'repeat(3, auto)' : layout === '4x2' ? 'repeat(2, auto)' : 'repeat(1, auto)' ,
652+ rowGap : layout === '4x2' ? { xs : 3 , sm : 4 } : { xs : 4 , sm : 4 } ,
653+ columnGap : layout === '4x2' ? { xs : 1 , sm : 2 } : { xs : 2 , sm : 4 } ,
656654 gridAutoFlow : 'row' , // Fill row by row (left to right, top to bottom)
657- justifyItems : ' stretch', // Items fill their grid cells
658- alignItems : 'stretch' ,
655+ justifyItems : layout === '4x2' ? ' stretch' : 'center' , // Stretch 4x2 items to fill grid cells, center others
656+ alignItems : 'center' , // Center items vertically within their grid cells
659657 justifyContent : 'center' , // Center the grid content horizontally
658+ alignContent : 'center' , // Center the entire grid vertically
660659 overflowY : 'hidden' ,
661660 overflowX : 'hidden' ,
662- p : { lg : 2 } ,
661+ p : 1 ,
663662 m : 0
664663 } }
665664 >
@@ -671,7 +670,7 @@ const GroupWidget: React.FC<GroupWidgetProps> = ({
671670 display : 'flex' ,
672671 justifyContent : 'center' ,
673672 alignItems : 'center' ,
674- maxWidth : gridSettings . maxWidth ,
673+ maxWidth : layout === '4x2' ? 'none' : gridSettings . maxWidth ,
675674 width : '100%' ,
676675 height : '100%'
677676 } }
@@ -736,7 +735,7 @@ const GroupWidget: React.FC<GroupWidgetProps> = ({
736735 display : 'flex' ,
737736 justifyContent : 'center' ,
738737 alignItems : 'center' ,
739- maxWidth : gridSettings . maxWidth ,
738+ maxWidth : layout === '4x2' ? 'none' : gridSettings . maxWidth ,
740739 width : '100%' ,
741740 height : '100%'
742741 } }
@@ -756,7 +755,6 @@ const GroupWidget: React.FC<GroupWidgetProps> = ({
756755 backgroundColor : 'rgba(255, 255, 255, 0.05)'
757756 }
758757 } }
759- onClick = { handleAddClick }
760758 title = 'Edit group to add items'
761759 >
762760 < AddIcon fontSize = 'medium' />
0 commit comments