Skip to content

Commit

Permalink
fix(Dialog): Classnames wasn't merged if set
Browse files Browse the repository at this point in the history
  • Loading branch information
JF-Cozy committed Oct 14, 2024
1 parent ecceb97 commit 8a9453c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions react/Dialog/index.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
import { default as MUIDialog } from '@material-ui/core/Dialog'
import cx from 'classnames'
import React from 'react'

import { useDialogEffects } from './DialogEffects'
import { useCozyTheme } from '../providers/CozyTheme'

const Dialog = props => {
const Dialog = ({ className, ...props }) => {
const { type, variant } = useCozyTheme()

useDialogEffects(props.open, props.fullScreen)

return <MUIDialog className={`CozyTheme--${type}-${variant}`} {...props} />
return (
<MUIDialog
className={cx(`CozyTheme--${type}-${variant}`, className)}
{...props}
/>
)
}

Dialog.defaultProps = {
Expand Down

0 comments on commit 8a9453c

Please sign in to comment.