From 862cecfd6349a6a35a6bf70799df35b248e28701 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 26 Jun 2019 18:49:18 +0800 Subject: [PATCH 1/2] :lipstick: Better className of PageHeader --- .../__tests__/__snapshots__/demo.test.js.snap | 28 +++++++++---------- .../__snapshots__/index.test.js.snap | 4 +-- components/page-header/index.tsx | 14 +++++----- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/components/page-header/__tests__/__snapshots__/demo.test.js.snap b/components/page-header/__tests__/__snapshots__/demo.test.js.snap index d65dbf9f7b..e3dbc0a336 100644 --- a/components/page-header/__tests__/__snapshots__/demo.test.js.snap +++ b/components/page-header/__tests__/__snapshots__/demo.test.js.snap @@ -39,20 +39,20 @@ exports[`renders ./components/page-header/demo/actions.md correctly 1`] = ` />
Title This is a subtitle
Title This is a subtitle @@ -519,10 +519,10 @@ exports[`renders ./components/page-header/demo/breadcrumb.md correctly 1`] = `
Title @@ -585,16 +585,16 @@ exports[`renders ./components/page-header/demo/content.md correctly 1`] = `
Title
Page Title diff --git a/components/page-header/index.tsx b/components/page-header/index.tsx index b25044a7fa..a560b02fa4 100644 --- a/components/page-header/index.tsx +++ b/components/page-header/index.tsx @@ -67,14 +67,14 @@ const renderHeader = (prefixCls: string, props: PageHeaderProps) => { const renderTitle = (prefixCls: string, props: PageHeaderProps) => { const { title, subTitle, tags, extra } = props; - const titlePrefixCls = `${prefixCls}-title-view`; + const headingPrefixCls = `${prefixCls}-heading`; if (title || subTitle || tags || extra) { return ( -
- {title && {title}} - {subTitle && {subTitle}} - {tags && {tags}} - {extra && {extra}} +
+ {title && {title}} + {subTitle && {subTitle}} + {tags && {tags}} + {extra && {extra}}
); } @@ -112,7 +112,7 @@ const PageHeader: React.SFC = props => (
{renderHeader(prefixCls, props)} {renderTitle(prefixCls, props)} - {children &&
{children}
} + {children &&
{children}
} {renderFooter(prefixCls, footer)}
); From bdfcc912c05dd496041d5fe3a2207ece5f03c08d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Thu, 27 Jun 2019 23:33:27 +0800 Subject: [PATCH 2/2] fix style warning --- components/page-header/style/index.less | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/page-header/style/index.less b/components/page-header/style/index.less index 64bc1b191d..0bcd081fa7 100644 --- a/components/page-header/style/index.less +++ b/components/page-header/style/index.less @@ -31,11 +31,11 @@ margin: 0 12px; } - .@{ant-prefix}-breadcrumb { - margin-bottom: 12px; + .@{ant-prefix}-breadcrumb + &-heading { + margin-top: 12px; } - &-title-view { + &-heading { display: inline-block; &-title { display: inline-block; @@ -72,7 +72,7 @@ } } - &-content-view { + &-content { padding-top: 12px; }