mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 17:44:35 +08:00
style(Empty): 💄 create simple style Empty in a default way
This commit is contained in:
parent
e1a1cdaa4d
commit
5ee4efb2db
@ -10,7 +10,7 @@ const renderEmpty = (componentName?: string): React.ReactNode => (
|
||||
switch (componentName) {
|
||||
case 'Table':
|
||||
case 'List':
|
||||
return <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} className={`${prefix}-normal`} />;
|
||||
return <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />;
|
||||
|
||||
case 'Select':
|
||||
case 'TreeSelect':
|
||||
|
@ -20,7 +20,7 @@ ReactDOM.render(
|
||||
<Empty
|
||||
image="https://gw.alipayobjects.com/mdn/miniapp_social/afts/img/A*pevERLJC9v0AAAAAAAAAAABjAQAAAQ/original"
|
||||
imageStyle={{
|
||||
height: 200,
|
||||
height: 60,
|
||||
}}
|
||||
description={
|
||||
<span>
|
||||
|
@ -17,7 +17,7 @@ You can choose another style of `image` by setting image to `Empty.PRESENTED_IMA
|
||||
import { Empty } from 'antd';
|
||||
|
||||
ReactDOM.render(
|
||||
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} imageStyle={{ height:40 }} />,
|
||||
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />,
|
||||
mountNode
|
||||
);
|
||||
```
|
||||
|
@ -51,13 +51,20 @@ const OriginEmpty: React.SFC<EmptyProps> = (props: EmptyProps) => (
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={classNames(prefixCls, className)} {...restProps}>
|
||||
<div
|
||||
className={classNames(
|
||||
prefixCls,
|
||||
{
|
||||
[`${prefixCls}-normal`]: image === simpleEmptyImg,
|
||||
},
|
||||
className,
|
||||
)}
|
||||
{...restProps}
|
||||
>
|
||||
<div className={`${prefixCls}-image`} style={imageStyle}>
|
||||
{imageNode}
|
||||
</div>
|
||||
|
||||
<p className={`${prefixCls}-description`}>{des}</p>
|
||||
|
||||
{children && <div className={`${prefixCls}-footer`}>{children}</div>}
|
||||
</div>
|
||||
);
|
||||
|
@ -29,6 +29,7 @@
|
||||
// antd internal empty style
|
||||
&-small {
|
||||
margin: 8px 0;
|
||||
color: @disabled-color;
|
||||
|
||||
.@{empty-prefix-cls}-image {
|
||||
height: 35px;
|
||||
@ -37,6 +38,7 @@
|
||||
|
||||
&-normal {
|
||||
margin: 32px 0;
|
||||
color: @disabled-color;
|
||||
|
||||
.@{empty-prefix-cls}-image {
|
||||
height: 40px;
|
||||
|
@ -32,7 +32,7 @@
|
||||
|
||||
&-empty-text {
|
||||
padding: @list-empty-text-padding;
|
||||
color: @text-color-secondary;
|
||||
color: @disabled-color;
|
||||
font-size: @font-size-base;
|
||||
text-align: center;
|
||||
}
|
||||
|
@ -408,7 +408,7 @@
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
padding: @table-padding-vertical @table-padding-horizontal;
|
||||
color: @text-color-secondary;
|
||||
color: @disabled-color;
|
||||
font-size: @font-size-base;
|
||||
text-align: center;
|
||||
background: @component-background;
|
||||
|
Loading…
Reference in New Issue
Block a user