diff --git a/lib/pages/spaces_management/widgets/dialogs/delete_dialogue.dart b/lib/pages/spaces_management/widgets/dialogs/delete_dialogue.dart index 4e9b25fc..18a67dd2 100644 --- a/lib/pages/spaces_management/widgets/dialogs/delete_dialogue.dart +++ b/lib/pages/spaces_management/widgets/dialogs/delete_dialogue.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:syncrow_web/pages/common/buttons/cancel_button.dart'; import 'package:syncrow_web/utils/color_manager.dart'; void showDeleteConfirmationDialog(BuildContext context, VoidCallback onConfirm, bool isSpace) { @@ -74,22 +75,9 @@ void showDeleteConfirmationDialog(BuildContext context, VoidCallback onConfirm, Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - ElevatedButton( - onPressed: () { - Navigator.of(context).pop(); // Close the first dialog - // Trigger the second popup - }, - style: ElevatedButton.styleFrom( - backgroundColor: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12), - side: const BorderSide(color: ColorsManager.boxColor), // Black border - ), - ), - child: const Text( - 'Cancel', - style: TextStyle(color: Colors.black), - ), + CancelButton( + label: 'Cancel', + onPressed: () => Navigator.of(context).pop(), ), ElevatedButton( onPressed: () { @@ -97,11 +85,11 @@ void showDeleteConfirmationDialog(BuildContext context, VoidCallback onConfirm, showProcessingPopup(context, isSpace, onConfirm); }, style: ElevatedButton.styleFrom( - backgroundColor: Colors.blue, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(8.0), - ), - ), + backgroundColor: Colors.blue, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8.0), + ), + fixedSize: Size(140, 40)), child: const Text( 'Continue', style: TextStyle(color: Colors.white), @@ -184,13 +172,13 @@ void showProcessingPopup(BuildContext context, bool isSpace, VoidCallback onDele ElevatedButton( onPressed: () { // Trigger the second popup - onDelete(); + onDelete(); }, style: ElevatedButton.styleFrom( backgroundColor: ColorsManager.warningRed, + fixedSize: Size(140, 40), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(12), - side: const BorderSide(color: ColorsManager.boxColor), // Black border ), ), child: const Text( @@ -198,20 +186,9 @@ void showProcessingPopup(BuildContext context, bool isSpace, VoidCallback onDele style: TextStyle(color: Colors.white), ), ), - ElevatedButton( - onPressed: () { - Navigator.of(context).pop(); // Close the first dialog - }, - style: ElevatedButton.styleFrom( - backgroundColor: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(8.0), - ), - ), - child: const Text( - 'Cancel', - style: TextStyle(color: Colors.black), - ), + CancelButton( + label: 'Cancel', + onPressed: () => Navigator.of(context).pop(), ), ], ), diff --git a/lib/pages/spaces_management/widgets/sidebar_widget.dart b/lib/pages/spaces_management/widgets/sidebar_widget.dart index 94817e75..507cd703 100644 --- a/lib/pages/spaces_management/widgets/sidebar_widget.dart +++ b/lib/pages/spaces_management/widgets/sidebar_widget.dart @@ -50,7 +50,7 @@ class _SidebarWidgetState extends State { super.didUpdateWidget(oldWidget); if (widget.selectedSpaceUuid != oldWidget.selectedSpaceUuid) { setState(() { - _selectedId = widget.selectedSpaceUuid; + _selectedId = widget.selectedSpaceUuid; }); } } @@ -86,8 +86,6 @@ class _SidebarWidgetState extends State { final containsQueryInSpaces = community.spaces.any((space) => _containsQuery(space, _searchQuery.toLowerCase())); - - return containsQueryInCommunity || containsQueryInSpaces; }).toList(); } @@ -140,10 +138,10 @@ class _SidebarWidgetState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text( - 'Communities', - style: Theme.of(context).textTheme.titleMedium, - ), + Text('Communities', + style: Theme.of(context).textTheme.titleMedium?.copyWith( + color: Colors.black, + )), GestureDetector( onTap: () => _showCreateCommunityDialog(context), child: Container( @@ -238,7 +236,7 @@ class _SidebarWidgetState extends State { } if (widget.onSelectedSpaceChanged != null) { - widget.onSelectedSpaceChanged!(space.uuid); + widget.onSelectedSpaceChanged!(space.uuid); } }, children: space.children.isNotEmpty