From c9cff1bcdf2fb9ff600481c32a770e564800b51e Mon Sep 17 00:00:00 2001 From: Haixing <65376724+HaixingOoO@users.noreply.github.com> Date: Wed, 15 Nov 2023 11:47:58 +0800 Subject: [PATCH] fix(dialog): fix dialog header is null or no,the close-button is not in the upper right corner (#2593) * fix(dialog): fix dialog header is null or no,the close-button is not in the upper right corner * test: update test snap --------- Co-authored-by: Heising --- src/dialog/DialogCard.tsx | 3 +++ test/snap/__snapshots__/csr.test.jsx.snap | 12 ++++++++++++ test/snap/__snapshots__/ssr.test.jsx.snap | 4 ++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/dialog/DialogCard.tsx b/src/dialog/DialogCard.tsx index 4ee9f4e182..4a0acdce8f 100644 --- a/src/dialog/DialogCard.tsx +++ b/src/dialog/DialogCard.tsx @@ -98,6 +98,9 @@ const DialogCard = forwardRef((props, ref) => { return ( ) => onCloseBtnClick?.({ e })} > {closeIcon()} diff --git a/test/snap/__snapshots__/csr.test.jsx.snap b/test/snap/__snapshots__/csr.test.jsx.snap index 01dc0d97cf..c9b10d7b7c 100644 --- a/test/snap/__snapshots__/csr.test.jsx.snap +++ b/test/snap/__snapshots__/csr.test.jsx.snap @@ -65895,6 +65895,7 @@ exports[`csr snapshot test > csr test src/config-provider/_example/dialog.jsx 1` csr test src/config-provider/_example/dialog.jsx 1` csr test src/config-provider/_example/dialog.jsx 1` csr test src/config-provider/_example/dialog.jsx 1` csr test src/config-provider/_example/dialog.jsx 1` csr test src/config-provider/_example/dialog.jsx 1` csr test src/config-provider/_example/dialog.jsx 1` csr test src/config-provider/_example/dialog.jsx 1` csr test src/config-provider/_example/dialog.jsx 1` csr test src/config-provider/_example/dialog.jsx 1` csr test src/dialog/_example/modal.jsx 1`] = ` csr test src/dialog/_example/modal.jsx 1`] = ` ssr test src/config-provider/_example/calendar.jsx exports[`ssr snapshot test > ssr test src/config-provider/_example/date-picker.jsx 1`] = `"
~
~
~
"`; -exports[`ssr snapshot test > ssr test src/config-provider/_example/dialog.jsx 1`] = `"
Title
Would you like to be my friends?
confirm
Would you like to be my friends?
confirm
Would you like to be my friends?
confirm
Would you like to be my friends?
confirm
Would you like to be my friends?
"`; +exports[`ssr snapshot test > ssr test src/config-provider/_example/dialog.jsx 1`] = `"
Title
Would you like to be my friends?
confirm
Would you like to be my friends?
confirm
Would you like to be my friends?
confirm
Would you like to be my friends?
confirm
Would you like to be my friends?
"`; exports[`ssr snapshot test > ssr test src/config-provider/_example/global.jsx 1`] = `"

使用ConfigProvider包裹业务功能的最外层组件,点击下方图标查看示例代码

英文语言包引入路径:import enConfig from 'tdesign-react/es/locale/en_US';

中文语言包引入路径:import zhConfig from 'tdesign-react/es/locale/zh_CN';

日文语言包引入路径:import jpConfig from 'tdesign-react/es/locale/ja_JP';

韩文语言包引入路径:import koConfig from 'tdesign-react/es/locale/ko_KR';

"`; @@ -306,7 +306,7 @@ exports[`ssr snapshot test > ssr test src/dialog/_example/custom.jsx 1`] = `" ssr test src/dialog/_example/icon.jsx 1`] = `""`; -exports[`ssr snapshot test > ssr test src/dialog/_example/modal.jsx 1`] = `"
普通对话框

This is a dialog

"`; +exports[`ssr snapshot test > ssr test src/dialog/_example/modal.jsx 1`] = `"
普通对话框

This is a dialog

"`; exports[`ssr snapshot test > ssr test src/dialog/_example/plugin.jsx 1`] = `"

函数调用方式一:DialogPlugin(options)

函数调用方式二:DialogPlugin.confirm(options)

函数调用方式三:DialogPlugin.alert(options)

"`;