Skip to content

Commit

Permalink
feat: Popconfirm title and description props(update partial docs)
Browse files Browse the repository at this point in the history
  • Loading branch information
xhh0223 committed Dec 4, 2022
1 parent 5a09247 commit d2289e1
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion components/popconfirm/demo/basic.tsx
Expand Up @@ -13,7 +13,8 @@ const cancel = (e: React.MouseEvent<HTMLElement>) => {

const App: React.FC = () => (
<Popconfirm
title="Are you sure to delete this task?"
title="删除任务"
description="Are you sure to delete this task?"
onConfirm={confirm}
onCancel={cancel}
okText="Yes"
Expand Down
1 change: 1 addition & 0 deletions components/popconfirm/index.en-US.md
Expand Up @@ -40,6 +40,7 @@ The difference with the `confirm` modal dialog is that it's more lightweight tha
| okType | Button `type` of the Confirm button | string | `primary` | |
| showCancel | Show cancel button | boolean | true | 4.18.0 |
| title | The title of the confirmation box | ReactNode \| () => ReactNode | - | |
| title | The description of the confirmation box title | ReactNode \| () => ReactNode | - | |
| onCancel | A callback of cancel | function(e) | - | |
| onConfirm | A callback of confirmation | function(e) | - | |

Expand Down
2 changes: 1 addition & 1 deletion components/popconfirm/index.tsx
Expand Up @@ -15,7 +15,7 @@ import usePopconfirmStyle from './style';

export interface PopconfirmProps extends AbstractTooltipProps {
title: React.ReactNode | RenderFunction;
description: React.ReactNode | RenderFunction;
description?: React.ReactNode | RenderFunction;
disabled?: boolean;
onConfirm?: (e?: React.MouseEvent<HTMLElement>) => void;
onCancel?: (e?: React.MouseEvent<HTMLElement>) => void;
Expand Down
1 change: 1 addition & 0 deletions components/popconfirm/index.zh-CN.md
Expand Up @@ -41,6 +41,7 @@ demo:
| okType | 确认按钮类型 | string | `primary` | |
| showCancel | 是否显示取消按钮 | boolean | true | 4.18.0 |
| title | 确认框的描述 | ReactNode \| () => ReactNode | - | |
| description | 对确认框标题的描述 | ReactNode \| () => ReactNode | - | |
| onCancel | 点击取消的回调 | function(e) | - | |
| onConfirm | 点击确认的回调 | function(e) | - | |

Expand Down
1 change: 1 addition & 0 deletions components/popconfirm/style/index.tsx
Expand Up @@ -56,6 +56,7 @@ const genBaseStyle: GenerateStyle<PopconfirmToken> = (token) => {
[`${componentCls}-description`]: {
position: 'relative',
marginInlineStart: fontSize + marginXS,
marginBottom: marginXS,
color: colorText,
fontSize,
},
Expand Down

0 comments on commit d2289e1

Please sign in to comment.