From 5bf21c78e6ef7287d6f02c4de1a2a3b90200b30c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E7=88=B1=E5=90=83=E7=99=BD=E8=90=9D?= =?UTF-8?q?=E5=8D=9C?= Date: Thu, 7 Nov 2024 19:43:18 +0800 Subject: [PATCH] docs: add ref demo (#189) * docs: add ref demo * fix: lint --- components/sender/SenderHeader.tsx | 24 +-- .../__snapshots__/demo-extend.test.ts.snap | 166 ++++++++++++++++++ .../__tests__/__snapshots__/demo.test.ts.snap | 163 +++++++++++++++++ components/sender/demo/header-fixed.md | 7 + components/sender/demo/header-fixed.tsx | 45 +++++ components/sender/index.en-US.md | 1 + components/sender/index.zh-CN.md | 1 + 7 files changed, 396 insertions(+), 11 deletions(-) create mode 100644 components/sender/demo/header-fixed.md create mode 100644 components/sender/demo/header-fixed.tsx diff --git a/components/sender/SenderHeader.tsx b/components/sender/SenderHeader.tsx index 74cf4706..3953b750 100644 --- a/components/sender/SenderHeader.tsx +++ b/components/sender/SenderHeader.tsx @@ -73,7 +73,7 @@ export default function SenderHeader(props: SenderHeaderProps) { }} > {/* Header */} - {closable !== false && ( + {(closable !== false || title) && (
{title}
-
-
+ {closable !== false && ( +
+
+ )}
)} diff --git a/components/sender/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/sender/__tests__/__snapshots__/demo-extend.test.ts.snap index 8b270738..f049d9ca 100644 --- a/components/sender/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/sender/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -392,6 +392,172 @@ exports[`renders components/sender/demo/header.tsx extend context correctly 1`] exports[`renders components/sender/demo/header.tsx extend context correctly 2`] = `[]`; +exports[`renders components/sender/demo/header-fixed.tsx extend context correctly 1`] = ` +
+
+ +
+
+
+
+
+
+ + + +
+
+ + "Tell more about Ant Design X" + +
+
+
+
+ +
+
+
+
+