Skip to content

Commit df4bb61

Browse files
committed
fix: Now use correct css to deal with dark theme
for `BottomSheet`, `Modal` and `Dialog`
1 parent 0e2d1a7 commit df4bb61

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

react/BottomSheet/BottomSheet.jsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -436,11 +436,9 @@ BottomSheet.propTypes = {
436436
}
437437

438438
const BottomSheetPortal = forwardRef(({ portalProps, ...props }, ref) => {
439-
const { type, variant } = useCozyTheme()
439+
const { type } = useCozyTheme()
440440
const CozyThemeWrapper = portalProps?.disablePortal ? Fragment : CozyTheme
441-
const wrapperProps = portalProps?.disablePortal
442-
? undefined
443-
: { type, variant }
441+
const wrapperProps = portalProps?.disablePortal ? undefined : { type }
444442

445443
return (
446444
<Portal {...portalProps}>

react/Dialog/index.jsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,12 @@ import { useDialogEffects } from './DialogEffects'
66
import { useCozyTheme } from '../providers/CozyTheme'
77

88
const Dialog = ({ className, ...props }) => {
9-
const { type, variant } = useCozyTheme()
9+
const { type } = useCozyTheme()
1010

1111
useDialogEffects(props.open, props.fullScreen)
1212

1313
return (
14-
<MUIDialog
15-
className={cx(`TwakeTheme--${type}-${variant}`, className)}
16-
{...props}
17-
/>
14+
<MUIDialog className={cx(`TwakeTheme--${type}`, className)} {...props} />
1815
)
1916
}
2017

react/deprecated/Modal/index.jsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,15 +250,12 @@ ModalContent.propTypes = {
250250
}
251251

252252
const Modal = props => {
253-
const { type, variant } = useCozyTheme()
253+
const { type } = useCozyTheme()
254254

255255
return (
256256
<ModalWithoutTheme
257257
{...props}
258-
containerClassName={cx(
259-
props.containerClassName,
260-
`CozyTheme--${type}-${variant}`
261-
)}
258+
containerClassName={cx(props.containerClassName, `CozyTheme--${type}`)}
262259
/>
263260
)
264261
}

0 commit comments

Comments
 (0)