From 3e2e9c389c15908b6dc70ad224253d8287273eea Mon Sep 17 00:00:00 2001 From: zhouyun1 Date: Wed, 15 Nov 2023 20:42:44 +0800 Subject: [PATCH] feat(pop-confirm): add content api (#2666) --- .changeset/six-toys-grow.md | 5 ++++ .changeset/stupid-cobras-exist.md | 5 ++++ packages/ui/pop-confirm/src/PopConfirm.tsx | 7 ++++++ .../pop-confirm/src/styles/pop-confirm.scss | 11 ++++++-- .../stories/custom-content.stories.tsx | 25 +++++++++++++++++++ .../ui/pop-confirm/stories/index.stories.tsx | 1 + 6 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 .changeset/six-toys-grow.md create mode 100644 .changeset/stupid-cobras-exist.md create mode 100644 packages/ui/pop-confirm/stories/custom-content.stories.tsx diff --git a/.changeset/six-toys-grow.md b/.changeset/six-toys-grow.md new file mode 100644 index 000000000..1401bea83 --- /dev/null +++ b/.changeset/six-toys-grow.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/hiui": patch +--- + +feat(pop-confirm): add content api diff --git a/.changeset/stupid-cobras-exist.md b/.changeset/stupid-cobras-exist.md new file mode 100644 index 000000000..46daae191 --- /dev/null +++ b/.changeset/stupid-cobras-exist.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/pop-confirm": minor +--- + +feat: add content api diff --git a/packages/ui/pop-confirm/src/PopConfirm.tsx b/packages/ui/pop-confirm/src/PopConfirm.tsx index eaea9e9ae..97bc2ccb3 100644 --- a/packages/ui/pop-confirm/src/PopConfirm.tsx +++ b/packages/ui/pop-confirm/src/PopConfirm.tsx @@ -22,6 +22,7 @@ export const PopConfirm = forwardRef( className, children, title, + content, icon = defaultTipIcon, cancelText: cancelTextProp, confirmText: confirmTextProp, @@ -61,6 +62,8 @@ export const PopConfirm = forwardRef(
{title}
+ {content ?
{content}
: null} + {hasFooter ? (