feat: components used in confirm title and content support prefixCls (#27376)

This commit is contained in:
南北 2020-10-28 12:07:46 +08:00 committed by GitHub
parent 6880bf7073
commit 7c0e88839c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,7 @@ import classNames from 'classnames';
import Dialog, { ModalFuncProps } from './Modal';
import ActionButton from './ActionButton';
import devWarning from '../_util/devWarning';
import ConfigProvider from '../config-provider';
interface ConfirmDialogProps extends ModalFuncProps {
afterClose?: () => void;
@ -96,13 +97,15 @@ const ConfirmDialog = (props: ConfirmDialogProps) => {
getContainer={getContainer}
>
<div className={`${contentPrefixCls}-body-wrapper`}>
<div className={`${contentPrefixCls}-body`} style={bodyStyle}>
{icon}
{props.title === undefined ? null : (
<span className={`${contentPrefixCls}-title`}>{props.title}</span>
)}
<div className={`${contentPrefixCls}-content`}>{props.content}</div>
</div>
<ConfigProvider prefixCls={rootPrefixCls}>
<div className={`${contentPrefixCls}-body`} style={bodyStyle}>
{icon}
{props.title === undefined ? null : (
<span className={`${contentPrefixCls}-title`}>{props.title}</span>
)}
<div className={`${contentPrefixCls}-content`}>{props.content}</div>
</div>
</ConfigProvider>
<div className={`${contentPrefixCls}-btns`}>
{cancelButton}
<ActionButton