Skip to content

Commit 09bf5ba

Browse files
committed
Add sizing to hourglass
1 parent f33db32 commit 09bf5ba

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/components/Hourglass/index.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,22 @@ import React from 'react'
22
import PropTypes from 'prop-types'
33
import './style.css'
44

5-
export default function Hourglass({ color, className, style }) {
5+
export default function Hourglass({ color, size, className, style }) {
66
return (
77
<div className={`lds-hourglass ${className}`} style={{ ...style }}>
8-
<div className="lds-hourglass-after" style={{ background: color }}></div>
8+
<div
9+
className="lds-hourglass-after"
10+
style={{ background: color, 'border-width': size, 'border-height': size }}
11+
></div>
912
</div>
1013
)
1114
}
1215

1316
Hourglass.propTypes = {
1417
/** hex color */
1518
color: PropTypes.string,
19+
/** size in pixel */
20+
size: PropTypes.number,
1621
/** class name */
1722
className: PropTypes.string,
1823
/** style object */
@@ -22,5 +27,6 @@ Hourglass.propTypes = {
2227
Hourglass.defaultProps = {
2328
color: '#7f58af',
2429
className: '',
30+
size: 32,
2531
style: {},
2632
}

0 commit comments

Comments
 (0)