Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wisdom-components
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
wisdom-components
Commits
195dc64e
Commit
195dc64e
authored
Apr 09, 2021
by
涂茜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: update empty
parent
dcf8ae65
Pipeline
#25717
failed with stages
in 14 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
index.js
packages/Empty/src/index.js
+15
-3
No files found.
packages/Empty/src/index.js
View file @
195dc64e
...
@@ -2,17 +2,24 @@ import React, { useContext } from 'react';
...
@@ -2,17 +2,24 @@ import React, { useContext } from 'react';
import
PropTypes
from
'prop-types'
;
import
PropTypes
from
'prop-types'
;
import
classNames
from
'classnames'
;
import
classNames
from
'classnames'
;
import
{
ConfigProvider
}
from
'antd'
;
import
{
ConfigProvider
}
from
'antd'
;
import
noDataLight
from
'./assets/noDataLight.svg'
;
import
{
ReactComponent
as
noDataLight
}
from
'./assets/noDataLight.svg'
;
import
noDataDark
from
'./assets/noDataDark.svg'
;
import
{
ReactComponent
as
noDataDark
}
from
'./assets/noDataDark.svg'
;
import
errorLight
from
'./assets/errorLight.png'
;
import
errorLight
from
'./assets/errorLight.png'
;
import
errorDark
from
'./assets/errorDark.png'
;
import
errorDark
from
'./assets/errorDark.png'
;
import
'./index.less'
;
import
'./index.less'
;
const
IconBase
=
({
icon
:
SvgIcon
})
=>
{
const
SvgAttributes
=
{
width
:
'100%'
,
height
:
'100%'
,
};
return
<
SvgIcon
{...
SvgAttributes
}
/>
;
};
const
Empty
=
({
description
,
image
,
theme
,
size
,
statusCode
,
imageStyle
,
children
})
=>
{
const
Empty
=
({
description
,
image
,
theme
,
size
,
statusCode
,
imageStyle
,
children
})
=>
{
const
alt
=
description
?
description
:
'empty'
;
const
alt
=
description
?
description
:
'empty'
;
const
des
=
description
?
description
:
DESC_DATA
[
`
${
statusCode
}
`
];
const
des
=
description
?
description
:
DESC_DATA
[
`
${
statusCode
}
`
];
const
imageSrc
=
image
?
image
:
IMAGE_DATA
[
theme
][
statusCode
==
'0'
?
0
:
1
];
const
{
getPrefixCls
}
=
useContext
(
ConfigProvider
.
ConfigContext
);
const
{
getPrefixCls
}
=
useContext
(
ConfigProvider
.
ConfigContext
);
const
prefixCls
=
getPrefixCls
(
'panda-empty'
);
const
prefixCls
=
getPrefixCls
(
'panda-empty'
);
...
@@ -20,7 +27,12 @@ const Empty = ({ description, image, theme, size, statusCode, imageStyle, childr
...
@@ -20,7 +27,12 @@ const Empty = ({ description, image, theme, size, statusCode, imageStyle, childr
let
imageNode
=
null
;
let
imageNode
=
null
;
if
(
typeof
image
===
'string'
)
{
if
(
typeof
image
===
'string'
)
{
if
(
statusCode
==
'0'
)
{
imageNode
=
<
IconBase
icon
=
{
IMAGE_DATA
[
theme
][
0
]}
/>
;
}
else
{
let
imageSrc
=
image
?
image
:
IMAGE_DATA
[
theme
][
1
];
imageNode
=
<
img
alt
=
{
alt
}
src
=
{
imageSrc
}
/>
;
imageNode
=
<
img
alt
=
{
alt
}
src
=
{
imageSrc
}
/>
;
}
}
else
{
}
else
{
imageNode
=
image
;
imageNode
=
image
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment