mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-09 06:55:03 +00:00
* style: enhance button layout and input styles across multiple components for improved UI consistency * style: update RequestsNotLoaded component with new warning styles and enhance theme color definitions for status indicators * refactor: update theme usage across components for consistency - Changed color references from theme.brand to theme.primary.text in various StyledWrapper components. - Added hover effects to enhance UI interactivity in CollectionSettings and FolderSettings. - Removed unnecessary margin and padding adjustments in several components for cleaner layout. - Improved accessibility by ensuring aria attributes are correctly set in MenuDropdown. - Standardized styling for method indicators in RequestPane components. These changes aim to create a more cohesive look and feel across the application while adhering to the updated theme guidelines. * refactor: clean up method selector styling in NewRequest component * chore: temp playwright test fixes * refactor: update modal sizes across various components for consistency - Changed modal size from "sm" to "md" in RenameWorkspace, CreateApiSpec, CloneCollection, DeleteCollectionItem, and RenameCollection components. - Improved styling in HttpMethodSelector by adding padding for better layout. - Updated theme color references in multiple theme files to use a new palette structure for consistency and maintainability. * refactor: enhance styling and theme integration in TimelineItem components - Updated HttpMethodSelector to clarify padding calculation in comments. - Integrated theme colors for OAuth2 indicator and timestamp in TimelineItem for better visual consistency. - Adjusted Method component to use uppercase styling for method display. - Modified RelativeTime component to apply muted text color for improved readability. - Updated INFO color in dark and light themes for better contrast and accessibility. * refactor: remove duplicate import statements in theme files - Cleaned up import statements in vscode.js and light-pastel.js by removing redundant lines for improved code clarity and maintainability. * refactor: improve styling and theme integration in various components - Added accent color and cursor style for checkbox inputs in Modal's StyledWrapper. - Updated border-radius values in HttpMethodSelector and NewRequest StyledWrapper components to use theme variables for consistency. - Introduced a new textbox class in NewRequest StyledWrapper for better styling control. - Changed modal size from "sm" to "md" in CreateEnvironment for improved layout. --------- Co-authored-by: Bijin A B <bijin@usebruno.com>
53 lines
1.6 KiB
JavaScript
53 lines
1.6 KiB
JavaScript
import React from 'react';
|
|
import { IconAlertTriangle } from '@tabler/icons';
|
|
import Modal from 'components/Modal';
|
|
import Button from 'ui/Button';
|
|
|
|
const ConfirmRequestClose = ({ item, example, onCancel, onCloseWithoutSave, onSaveAndClose }) => {
|
|
const isExample = !!example;
|
|
const itemName = isExample ? example.name : item.name;
|
|
const itemType = isExample ? 'example' : 'request';
|
|
|
|
return (
|
|
<Modal
|
|
size="md"
|
|
title="Unsaved changes"
|
|
confirmText="Save and Close"
|
|
cancelText="Close without saving"
|
|
disableEscapeKey={true}
|
|
disableCloseOnOutsideClick={true}
|
|
closeModalFadeTimeout={150}
|
|
handleCancel={onCancel}
|
|
onClick={(e) => {
|
|
e.stopPropagation();
|
|
e.preventDefault();
|
|
}}
|
|
hideFooter={true}
|
|
>
|
|
<div className="flex items-center font-normal">
|
|
<IconAlertTriangle size={32} strokeWidth={1.5} className="text-yellow-600" />
|
|
<h1 className="ml-2 text-lg font-medium">Hold on..</h1>
|
|
</div>
|
|
<div className="font-normal mt-4">
|
|
You have unsaved changes in {itemType} <span className="font-medium">{itemName}</span>.
|
|
</div>
|
|
|
|
<div className="flex justify-between mt-6">
|
|
<div>
|
|
<Button color="danger" onClick={onCloseWithoutSave}>
|
|
Don't Save
|
|
</Button>
|
|
</div>
|
|
<div className="flex gap-2">
|
|
<Button size="sm" color="secondary" variant="ghost" onClick={onCancel}>
|
|
Cancel
|
|
</Button>
|
|
<Button onClick={onSaveAndClose}>Save</Button>
|
|
</div>
|
|
</div>
|
|
</Modal>
|
|
);
|
|
};
|
|
|
|
export default ConfirmRequestClose;
|