Skip to content

Commit 19b2a6f

Browse files
committed
Fixed #8053 - Add showCloseIcon props to Dialog
1 parent 633929b commit 19b2a6f

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

components/landing/blocksection.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import { Tag } from '@/components/lib/tag/Tag';
12
import { classNames } from '@/components/lib/utils/ClassNames';
23
import { useEffect, useState } from 'react';
3-
import { Tag } from '@/components/lib/tag/Tag';
44

55
const BlockSection = () => {
66
const [animation, setAnimation] = useState(false);
@@ -11,7 +11,7 @@ const BlockSection = () => {
1111

1212
return (
1313
<section id="blocks-section" className="landing-blocks pt-8 overflow-hidden">
14-
<div className="section-header" style={{ display: 'flex', 'align-items': 'center', 'justify-content': 'center', gap: '1rem' }}>
14+
<div className="section-header" style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', gap: '1rem' }}>
1515
PrimeBlocks
1616
<Tag value="Coming Soon" severity="warning"></Tag>
1717
</div>

components/lib/dialog/Dialog.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export const Dialog = React.forwardRef((inProps, ref) => {
7575
let activeElement = document.activeElement;
7676
let isActiveElementInDialog = activeElement && dialogRef.current && dialogRef.current.contains(activeElement);
7777

78-
if (!isActiveElementInDialog && props.closable && props.showHeader && closeRef.current) {
78+
if (!isActiveElementInDialog && props.closable && props.showCloseIcon && props.showHeader && closeRef.current) {
7979
closeRef.current.focus();
8080
}
8181
};
@@ -428,7 +428,7 @@ export const Dialog = React.forwardRef((inProps, ref) => {
428428
}));
429429

430430
const createCloseIcon = () => {
431-
if (props.closable) {
431+
if (props.closable && props.showCloseIcon) {
432432
const labelAria = props.ariaCloseIconLabel || ariaLabel('close');
433433

434434
const closeButtonIconProps = mergeProps(

components/lib/dialog/DialogBase.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ export const DialogBase = ComponentBase.extend({
295295
resizable: true,
296296
rtl: false,
297297
showHeader: true,
298+
showCloseIcon: true,
298299
style: null,
299300
transitionOptions: null,
300301
visible: false,

components/lib/dialog/dialog.d.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ export interface DialogProps {
219219
*/
220220
className?: string | undefined;
221221
/**
222-
* Adds a close icon to the header to hide the dialog.
222+
* When enabled, the dialog can be closed by clicking the close icon, pressing escape key or clicking the modal background.
223223
* @defaultValue true
224224
*/
225225
closable?: boolean | undefined;
@@ -337,6 +337,11 @@ export interface DialogProps {
337337
* @defaultValue true
338338
*/
339339
showHeader?: boolean | undefined;
340+
/**
341+
* When enabled, the close icon is displayed in the header.
342+
* @defaultValue true
343+
*/
344+
showCloseIcon?: boolean | undefined;
340345
/**
341346
* Icon to display in the dialog maximize button when dialog is not maximized.
342347
*/

0 commit comments

Comments
 (0)