New loading placeholder and transparent placeholders.
This commit is contained in:
parent
8310e7d12b
commit
69c8ecd23a
38
src/components/Dashboard/common/LoadingPlaceholder.jsx
Normal file
38
src/components/Dashboard/common/LoadingPlaceholder.jsx
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
import { Card, Flex, Typography } from 'antd'
|
||||||
|
import { LoadingOutlined } from '@ant-design/icons'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
|
const { Text } = Typography
|
||||||
|
|
||||||
|
const LoadingPlaceholder = ({ message, hasBackground = true }) => {
|
||||||
|
return (
|
||||||
|
<Card
|
||||||
|
size='small'
|
||||||
|
style={{
|
||||||
|
background: hasBackground == false ? 'transparent' : undefined,
|
||||||
|
border: hasBackground == false ? '1px solid rgb(0 0 0 / 7%)' : undefined
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Flex
|
||||||
|
justify='center'
|
||||||
|
gap={'small'}
|
||||||
|
style={{
|
||||||
|
height: '100%'
|
||||||
|
}}
|
||||||
|
align='center'
|
||||||
|
>
|
||||||
|
<Text type='secondary'>
|
||||||
|
<LoadingOutlined />
|
||||||
|
</Text>
|
||||||
|
<Text type='secondary'>{message}</Text>
|
||||||
|
</Flex>
|
||||||
|
</Card>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
LoadingPlaceholder.propTypes = {
|
||||||
|
message: PropTypes.string.isRequired,
|
||||||
|
hasBackground: PropTypes.bool
|
||||||
|
}
|
||||||
|
|
||||||
|
export default LoadingPlaceholder
|
||||||
@ -4,13 +4,21 @@ import PropTypes from 'prop-types'
|
|||||||
|
|
||||||
const { Text } = Typography
|
const { Text } = Typography
|
||||||
|
|
||||||
const MissingPlaceholder = ({ message }) => {
|
const MissingPlaceholder = ({ message, hasBackground = true }) => {
|
||||||
return (
|
return (
|
||||||
<Card size='small'>
|
<Card
|
||||||
|
size='small'
|
||||||
|
style={{
|
||||||
|
background: hasBackground == false ? 'transparent' : undefined,
|
||||||
|
border: hasBackground == false ? '1px solid rgb(0 0 0 / 7%)' : undefined
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Flex
|
<Flex
|
||||||
justify='center'
|
justify='center'
|
||||||
gap={'small'}
|
gap={'small'}
|
||||||
style={{ height: '100%' }}
|
style={{
|
||||||
|
height: '100%'
|
||||||
|
}}
|
||||||
align='center'
|
align='center'
|
||||||
>
|
>
|
||||||
<Text type='secondary'>
|
<Text type='secondary'>
|
||||||
@ -23,7 +31,8 @@ const MissingPlaceholder = ({ message }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
MissingPlaceholder.propTypes = {
|
MissingPlaceholder.propTypes = {
|
||||||
message: PropTypes.string.isRequired
|
message: PropTypes.string.isRequired,
|
||||||
|
hasBackground: PropTypes.bool
|
||||||
}
|
}
|
||||||
|
|
||||||
export default MissingPlaceholder
|
export default MissingPlaceholder
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user