Skip to content

Commit

Permalink
fix(Dialog): conditionally render title prop
Browse files Browse the repository at this point in the history
  • Loading branch information
kramer2005 committed Jul 4, 2023
1 parent 6b0c15d commit 7ce0b09
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flipper-ui",
"version": "0.29.4",
"version": "0.29.5",
"description": "",
"main": "dist/index.js",
"homepage": "https://flipper-ui.ngi.com.br/",
Expand Down
4 changes: 4 additions & 0 deletions src/core/feedback/dialog/dialog.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ describe('Dialog', () => {
render(
<Dialog
open
aria-title='dialog-paper'
title='My beautiful Dialog'
text={'Is not it?'}
onClose={jest.fn()}
Expand All @@ -114,6 +115,7 @@ describe('Dialog', () => {
render(
<Dialog
open
aria-title='dialog-paper'
title='My beautiful Dialog'
text={'Is not it?'}
onClose={jest.fn()}
Expand All @@ -134,6 +136,7 @@ describe('Dialog', () => {
render(
<Dialog
open
aria-title='dialog-paper'
title='My beautiful Dialog'
text={'Is not it?'}
onClose={jest.fn()}
Expand All @@ -154,6 +157,7 @@ describe('Dialog', () => {
render(
<Dialog
open
aria-title='dialog-paper'
title='My beautiful Dialog'
text={'Is not it?'}
onClose={jest.fn()}
Expand Down
4 changes: 3 additions & 1 deletion src/core/feedback/dialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export interface DialogProps
snippetContentStyle?: CSSProperties
contentTextStyle?: CSSProperties
scroll?: 'body' | 'paper' | 'unset-paper' | 'unset-body'
'aria-title'?: string
onClose?: (event: Event) => void
}

Expand Down Expand Up @@ -86,6 +87,7 @@ export const Dialog = ({
title,
snippetStyle,
snippetContentStyle,
'aria-title': ariaTitle,
...otherProps
}: DialogProps) => {
const classes = useStyles()
Expand Down Expand Up @@ -176,7 +178,7 @@ export const Dialog = ({
maxWidth={maxWidth}
scroll={scrollMode}
PaperProps={{
title: 'dialog-paper',
...(ariaTitle ? { title: ariaTitle } : {}),
classes:
scroll === 'unset-body' || scroll === 'unset-paper'
? { root: classes.root }
Expand Down

0 comments on commit 7ce0b09

Please sign in to comment.