2020-08-17 21:07:16 +01:00
|
|
|
import React from 'react'
|
2020-08-17 21:59:29 +01:00
|
|
|
import PropTypes from 'prop-types'
|
2020-07-28 21:06:45 +01:00
|
|
|
import { CX } from '../../constants'
|
|
|
|
import { getRandomInt } from '../../utils/numbers'
|
|
|
|
import PlaceholderLayout from './placeholder_layout'
|
|
|
|
|
2020-08-17 21:07:16 +01:00
|
|
|
class AccountPlaceholder extends React.PureComponent {
|
2020-07-28 21:06:45 +01:00
|
|
|
|
|
|
|
render() {
|
2020-07-29 21:40:47 +01:00
|
|
|
const { isLast, isSmall } = this.props
|
2020-07-28 21:06:45 +01:00
|
|
|
|
|
|
|
const classes = CX({
|
2020-08-18 21:49:11 +01:00
|
|
|
d: 1,
|
2020-07-28 21:06:45 +01:00
|
|
|
px15: 1,
|
|
|
|
py7: 1,
|
|
|
|
borderColorSecondary: !isLast,
|
|
|
|
borderBottom1PX: !isLast,
|
|
|
|
})
|
|
|
|
|
|
|
|
const width = getRandomInt(120, 300)
|
|
|
|
|
2020-07-29 21:40:47 +01:00
|
|
|
if (isSmall) {
|
|
|
|
return (
|
|
|
|
<div className={classes}>
|
|
|
|
<PlaceholderLayout viewBox='0 0 400 60'>
|
|
|
|
<circle cx='27' cy='28' r='27' />
|
|
|
|
<rect x='72' y='10' rx='5' ry='5' width={width} height='14' />
|
|
|
|
<rect x='72' y='36' rx='5' ry='5' width='108' height='14' />
|
|
|
|
</PlaceholderLayout>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2020-07-28 21:06:45 +01:00
|
|
|
return (
|
|
|
|
<div className={classes}>
|
2020-07-29 21:40:47 +01:00
|
|
|
<PlaceholderLayout viewBox='0 0 400 32'>
|
|
|
|
<rect x="38" y="4" rx="3" ry="3" width="268" height="6" />
|
2020-08-14 18:44:58 +01:00
|
|
|
<circle cx="14" cy="14" r="14" />
|
2020-07-29 21:40:47 +01:00
|
|
|
<rect x="36" y="18" rx="3" ry="3" width="208" height="6" />
|
2020-07-28 21:06:45 +01:00
|
|
|
</PlaceholderLayout>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2020-08-14 18:44:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
AccountPlaceholder.propTypes = {
|
|
|
|
isLast: PropTypes.bool,
|
|
|
|
isSmall: PropTypes.bool,
|
|
|
|
}
|
|
|
|
|
|
|
|
export default AccountPlaceholder
|