Improved missing placeholder.
This commit is contained in:
parent
6725b1c399
commit
f289bbb6b2
@ -60,7 +60,11 @@ const AppContent = () => {
|
|||||||
theme={themeConfig}
|
theme={themeConfig}
|
||||||
renderEmpty={() => (
|
renderEmpty={() => (
|
||||||
<div style={{ margin: '32px' }}>
|
<div style={{ margin: '32px' }}>
|
||||||
<MissingPlaceholder message='No data.' hasBackground={false} />
|
<MissingPlaceholder
|
||||||
|
message='No data.'
|
||||||
|
hasBackground={false}
|
||||||
|
hasBorder={false}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
|
|||||||
@ -4,13 +4,22 @@ import PropTypes from 'prop-types'
|
|||||||
|
|
||||||
const { Text } = Typography
|
const { Text } = Typography
|
||||||
|
|
||||||
const MissingPlaceholder = ({ message, hasBackground = true }) => {
|
const MissingPlaceholder = ({
|
||||||
|
message,
|
||||||
|
hasBackground = true,
|
||||||
|
hasBorder = true
|
||||||
|
}) => {
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
size='small'
|
size='small'
|
||||||
style={{
|
style={{
|
||||||
background: hasBackground == false ? 'transparent' : undefined,
|
background: hasBackground == false ? 'transparent' : undefined,
|
||||||
border: hasBackground == false ? '1px solid rgb(0 0 0 / 7%)' : undefined
|
border:
|
||||||
|
hasBorder == false
|
||||||
|
? 'none'
|
||||||
|
: hasBackground == false
|
||||||
|
? '1px solid rgb(0 0 0 / 7%)'
|
||||||
|
: undefined
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Flex
|
<Flex
|
||||||
@ -32,7 +41,8 @@ const MissingPlaceholder = ({ message, hasBackground = true }) => {
|
|||||||
|
|
||||||
MissingPlaceholder.propTypes = {
|
MissingPlaceholder.propTypes = {
|
||||||
message: PropTypes.string.isRequired,
|
message: PropTypes.string.isRequired,
|
||||||
hasBackground: PropTypes.bool
|
hasBackground: PropTypes.bool,
|
||||||
|
hasBorder: PropTypes.bool
|
||||||
}
|
}
|
||||||
|
|
||||||
export default MissingPlaceholder
|
export default MissingPlaceholder
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user