From 89a8df1d415a5da8e2a39886416b0445a3fc3727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Mon, 1 Jul 2019 15:11:37 +0800 Subject: [PATCH 1/5] fix classname is undefined --- components/result/__tests__/__snapshots__/demo.test.js.snap | 6 +++--- components/result/index.tsx | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/result/__tests__/__snapshots__/demo.test.js.snap b/components/result/__tests__/__snapshots__/demo.test.js.snap index cb0fac80f3..3f2793fd69 100644 --- a/components/result/__tests__/__snapshots__/demo.test.js.snap +++ b/components/result/__tests__/__snapshots__/demo.test.js.snap @@ -143,7 +143,7 @@ exports[`renders ./components/result/demo/basic.md correctly 1`] = `

= props => ( {({ getPrefixCls }: ConfigConsumerProps) => { const { prefixCls: customizePrefixCls, - className, + className: customizeClassName, subTitle, title, style, children, status, } = props; - const prefixCls = getPrefixCls('result', customizePrefixCls); + const className = classnames(prefixCls, ` ${prefixCls}-${status}`, customizeClassName); return ( -
+
{renderIcon(prefixCls, props)}
{title}
{subTitle &&
{subTitle}
} From 00bcb6928e7d2b7356159afbbf198ff5200794f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Mon, 1 Jul 2019 15:22:29 +0800 Subject: [PATCH 2/5] remove spaces --- components/result/__tests__/__snapshots__/demo.test.js.snap | 6 +++--- components/result/index.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/result/__tests__/__snapshots__/demo.test.js.snap b/components/result/__tests__/__snapshots__/demo.test.js.snap index 3f2793fd69..0a0a26dd24 100644 --- a/components/result/__tests__/__snapshots__/demo.test.js.snap +++ b/components/result/__tests__/__snapshots__/demo.test.js.snap @@ -143,7 +143,7 @@ exports[`renders ./components/result/demo/basic.md correctly 1`] = `

= props => ( status, } = props; const prefixCls = getPrefixCls('result', customizePrefixCls); - const className = classnames(prefixCls, ` ${prefixCls}-${status}`, customizeClassName); + const className = classnames(prefixCls, `${prefixCls}-${status}`, customizeClassName); return (
{renderIcon(prefixCls, props)} From 9b8ccc4ee7de1e26e898165e2e41158f628ed966 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Mon, 1 Jul 2019 15:28:02 +0800 Subject: [PATCH 3/5] add className test --- components/result/__tests__/index.test.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/result/__tests__/index.test.js b/components/result/__tests__/index.test.js index 95614e2372..084077fa35 100644 --- a/components/result/__tests__/index.test.js +++ b/components/result/__tests__/index.test.js @@ -47,4 +47,9 @@ describe('Progress', () => { const wrapper = mount(); expect(wrapper.find('.ant-result-extra')).toHaveLength(0); }); + + it('🙂 result should support className', () => { + const wrapper = mount(); + expect(wrapper.find('.ant-result.my-result')).toHaveLength(1); + }); }); From 439b85f8d26145d5b00838c9f7f91602f246f3b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Mon, 1 Jul 2019 19:26:57 +0800 Subject: [PATCH 4/5] fix style pollution problem --- components/result/style/index.less | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/result/style/index.less b/components/result/style/index.less index 63eb8105bf..e01883ec88 100644 --- a/components/result/style/index.less +++ b/components/result/style/index.less @@ -8,19 +8,19 @@ background-color: @component-background; // status color - &-success .anticon { + &-success &-icon > .anticon { color: @success-color; } - &-error .anticon { + &-error &-icon > .anticon { color: @error-color; } - &-info .anticon { + &-info &-icon > .anticon { color: @info-color; } - &-warning .anticon { + &-warning &-icon > .anticon { color: @warning-color; } From 2c4976bbdb2bb84cf94cf8d8119c3d07e370afd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Tue, 2 Jul 2019 14:21:47 +0800 Subject: [PATCH 5/5] remove background-color --- components/result/style/index.less | 2 -- 1 file changed, 2 deletions(-) diff --git a/components/result/style/index.less b/components/result/style/index.less index e01883ec88..feaa6d1411 100644 --- a/components/result/style/index.less +++ b/components/result/style/index.less @@ -5,8 +5,6 @@ .@{result-prefix-cls} { padding: 48px 32px; - background-color: @component-background; - // status color &-success &-icon > .anticon { color: @success-color;