mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-28 15:14:06 +00:00
chore: update delete confirmation modals to use danger button color (#6589)
* refactor: remove size prop from Button components for consistency across modals and improve styling * style: update confirm button colors in modal components for consistency
This commit is contained in:
@@ -23,12 +23,12 @@ const ClearDomainCookiesModal = ({ onClose, domain, onClear }) => (
|
||||
|
||||
<div className="flex justify-between mt-6">
|
||||
<div>
|
||||
<Button size="sm" color="secondary" variant="ghost" onClick={onClose}>
|
||||
<Button color="secondary" variant="ghost" onClick={onClose}>
|
||||
Close
|
||||
</Button>
|
||||
</div>
|
||||
<div>
|
||||
<Button size="sm" color="danger" onClick={onClear}>
|
||||
<Button color="danger" onClick={onClear}>
|
||||
Clear All
|
||||
</Button>
|
||||
</div>
|
||||
@@ -48,12 +48,12 @@ const DeleteCookieModal = ({ onClose, cookieName, onDelete }) => (
|
||||
|
||||
<div className="flex justify-between mt-6">
|
||||
<div>
|
||||
<Button size="sm" color="secondary" variant="ghost" onClick={onClose}>
|
||||
<Button color="secondary" variant="ghost" onClick={onClose}>
|
||||
Close
|
||||
</Button>
|
||||
</div>
|
||||
<div>
|
||||
<Button size="sm" color="danger" onClick={onDelete}>
|
||||
<Button color="danger" onClick={onDelete}>
|
||||
Delete
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -26,15 +26,15 @@ const ConfirmCloseEnvironment = ({ onCancel, onCloseWithoutSave, onSaveAndClose,
|
||||
|
||||
<div className="flex justify-between mt-6">
|
||||
<div>
|
||||
<Button size="sm" color="danger" onClick={onCloseWithoutSave}>
|
||||
<Button color="danger" onClick={onCloseWithoutSave}>
|
||||
Don't Save
|
||||
</Button>
|
||||
</div>
|
||||
<div>
|
||||
<Button size="sm" color="secondary" variant="ghost" onClick={onCancel}>
|
||||
<Button className="mr-2" color="secondary" variant="ghost" onClick={onCancel}>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button size="sm" onClick={onSaveAndClose}>
|
||||
<Button onClick={onSaveAndClose}>
|
||||
Save
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -26,6 +26,7 @@ const DeleteEnvironment = ({ onClose, environment, collection }) => {
|
||||
confirmText="Delete"
|
||||
handleConfirm={onConfirm}
|
||||
handleCancel={onClose}
|
||||
confirmButtonColor="danger"
|
||||
>
|
||||
Are you sure you want to delete <span className="font-medium">{environment.name}</span> ?
|
||||
</Modal>
|
||||
|
||||
@@ -30,15 +30,15 @@ const ConfirmCollectionClose = ({ collection, onCancel, onCloseWithoutSave, onSa
|
||||
|
||||
<div className="flex justify-between mt-6">
|
||||
<div>
|
||||
<Button size="sm" color="danger" onClick={onCloseWithoutSave}>
|
||||
<Button color="danger" onClick={onCloseWithoutSave}>
|
||||
Don't Save
|
||||
</Button>
|
||||
</div>
|
||||
<div>
|
||||
<Button size="sm" color="secondary" variant="ghost" onClick={onCancel}>
|
||||
<Button className="mr-2" color="secondary" variant="ghost" onClick={onCancel}>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button size="sm" onClick={onSaveAndClose}>
|
||||
<Button onClick={onSaveAndClose}>
|
||||
Save
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -30,15 +30,15 @@ const ConfirmFolderClose = ({ folder, onCancel, onCloseWithoutSave, onSaveAndClo
|
||||
|
||||
<div className="flex justify-between mt-6">
|
||||
<div>
|
||||
<Button size="sm" color="danger" onClick={onCloseWithoutSave}>
|
||||
<Button color="danger" onClick={onCloseWithoutSave}>
|
||||
Don't Save
|
||||
</Button>
|
||||
</div>
|
||||
<div>
|
||||
<Button size="sm" color="secondary" variant="ghost" onClick={onCancel}>
|
||||
<Button className="mr-2" color="secondary" variant="ghost" onClick={onCancel}>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button size="sm" onClick={onSaveAndClose}>
|
||||
<Button onClick={onSaveAndClose}>
|
||||
Save
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -34,17 +34,15 @@ const ConfirmRequestClose = ({ item, example, onCancel, onCloseWithoutSave, onSa
|
||||
|
||||
<div className="flex justify-between mt-6">
|
||||
<div>
|
||||
<Button size="sm" color="danger" onClick={onCloseWithoutSave}>
|
||||
<Button color="danger" onClick={onCloseWithoutSave}>
|
||||
Don't Save
|
||||
</Button>
|
||||
</div>
|
||||
<div>
|
||||
<Button size="sm" color="secondary" variant="ghost" onClick={onCancel}>
|
||||
<Button className="mr-2" color="secondary" variant="ghost" onClick={onCancel}>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button size="sm" onClick={onSaveAndClose}>
|
||||
Save
|
||||
</Button>
|
||||
<Button onClick={onSaveAndClose}>Save</Button>
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
|
||||
@@ -43,6 +43,7 @@ const DeleteCollectionItem = ({ onClose, item, collectionUid }) => {
|
||||
size="sm"
|
||||
title={`Delete ${isFolder ? 'Folder' : 'Request'}`}
|
||||
confirmText="Delete"
|
||||
confirmButtonColor="danger"
|
||||
handleConfirm={onConfirm}
|
||||
handleCancel={onClose}
|
||||
>
|
||||
|
||||
@@ -103,15 +103,15 @@ const ConfirmCollectionCloseDrafts = ({ onClose, collection, collectionUid }) =>
|
||||
|
||||
<div className="flex justify-between mt-6">
|
||||
<div>
|
||||
<Button size="sm" color="danger" onClick={handleDiscardAll}>
|
||||
<Button color="danger" onClick={handleDiscardAll}>
|
||||
Discard and Remove
|
||||
</Button>
|
||||
</div>
|
||||
<div>
|
||||
<Button size="sm" color="secondary" variant="ghost" onClick={onClose}>
|
||||
<Button className="mr-2" color="secondary" variant="ghost" onClick={onClose}>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button size="sm" onClick={handleSaveAll}>
|
||||
<Button onClick={handleSaveAll}>
|
||||
{currentDrafts.length > 1 ? 'Save All and Remove' : 'Save and Remove'}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -58,7 +58,7 @@ const RemoveCollection = ({ onClose, collectionUid }) => {
|
||||
title="Remove Collection"
|
||||
customHeader={customHeader}
|
||||
confirmText="Remove"
|
||||
confirmButtonColor="danger"
|
||||
confirmButtonColor="warning"
|
||||
handleConfirm={onConfirm}
|
||||
handleCancel={onClose}
|
||||
>
|
||||
|
||||
@@ -227,15 +227,15 @@ const RemoveCollectionsModal = ({ collectionUids, onClose }) => {
|
||||
|
||||
<div className="flex justify-between mt-6">
|
||||
<div>
|
||||
<Button size="sm" color="danger" onClick={handleDiscard}>
|
||||
<Button color="danger" onClick={handleDiscard}>
|
||||
Discard and Close
|
||||
</Button>
|
||||
</div>
|
||||
<div>
|
||||
<Button size="sm" color="secondary" variant="ghost" onClick={handleCancel}>
|
||||
<Button className="mr-2" color="secondary" variant="ghost" onClick={handleCancel}>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button size="sm" onClick={handleSave}>
|
||||
<Button onClick={handleSave}>
|
||||
Save and Close
|
||||
</Button>
|
||||
</div>
|
||||
@@ -256,10 +256,10 @@ const RemoveCollectionsModal = ({ collectionUids, onClose }) => {
|
||||
Collections will be removed from the current workspace but will still be available in the file system and can be re-opened later.
|
||||
</div>
|
||||
<div className="flex justify-end mt-6">
|
||||
<Button size="sm" color="secondary" variant="ghost" onClick={handleCancel} className="mr-2" data-testid="modal-close-button">
|
||||
<Button className="mr-2" color="secondary" variant="ghost" onClick={handleCancel} data-testid="modal-close-button">
|
||||
Cancel
|
||||
</Button>
|
||||
<Button size="sm" onClick={handleCloseAllCollections}>
|
||||
<Button color="warning" onClick={handleCloseAllCollections}>
|
||||
{hasMultipleCollections ? 'Close All' : 'Close'}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -25,13 +25,12 @@ const ConfirmSwitchEnv = ({ onCancel }) => {
|
||||
</div>
|
||||
<div className="font-normal mt-4">You have unsaved changes in this environment.</div>
|
||||
|
||||
<div className="flex justify-between mt-6">
|
||||
<div className="flex justify-end mt-6">
|
||||
<div>
|
||||
<Button size="sm" color="danger" onClick={onCancel}>
|
||||
<Button color="warning" onClick={onCancel}>
|
||||
Close
|
||||
</Button>
|
||||
</div>
|
||||
<div></div>
|
||||
</div>
|
||||
</Modal>
|
||||
);
|
||||
|
||||
@@ -195,6 +195,7 @@ const CollectionsList = ({ workspace }) => {
|
||||
handleConfirm={confirmRemoveCollection}
|
||||
confirmText={isDelete ? 'Delete' : 'Remove'}
|
||||
cancelText="Cancel"
|
||||
confirmButtonColor={isDelete ? 'warning' : 'primary'}
|
||||
style="new"
|
||||
>
|
||||
<p className="text-gray-600 dark:text-gray-300">
|
||||
|
||||
@@ -158,15 +158,15 @@ const SaveRequestsModal = ({ onClose }) => {
|
||||
|
||||
<div className="flex justify-between mt-6">
|
||||
<div>
|
||||
<Button size="sm" color="danger" onClick={closeWithoutSave}>
|
||||
<Button color="danger" onClick={closeWithoutSave}>
|
||||
Don't Save
|
||||
</Button>
|
||||
</div>
|
||||
<div>
|
||||
<Button size="sm" color="secondary" variant="ghost" onClick={onClose}>
|
||||
<Button className="mr-2" color="secondary" variant="ghost" onClick={onClose}>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button size="sm" onClick={closeWithSave}>
|
||||
<Button onClick={closeWithSave}>
|
||||
{totalDraftsCount > 1 ? 'Save All' : 'Save'}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user