Skip to content

Commit 09b47e3

Browse files
authored
Merge pull request #14 from break7533/feature/facebook-sizing
Feature/facebook sizing
2 parents dc23e37 + b595e3d commit 09b47e3

4 files changed

Lines changed: 21 additions & 13 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Component that accepts `size` prop have a default size in pixel.
3636
| `<Default/>` | `#7f58af` | - | `""` | `{}` |
3737
| `<DualRing/>` | `#7f58af` | `80` | `""` | `{}` |
3838
| `<Ellipsis/>` | `#7f58af` | - | `""` | `{}` |
39-
| `<Facebook/>` | `#7f58af` | - | `""` | `{}` |
39+
| `<Facebook/>` | `#7f58af` | `80` | `""` | `{}` |
4040
| `<Grid/>` | `#7f58af` | - | `""` | `{}` |
4141
| `<Heart/>` | `#7f58af` | `80` | `""` | `{}` |
4242
| `<Hourglass/>` | `#7f58af` | - | `""` | `{}` |

src/components/Facebook/index.js

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

5-
export default function Facebook({ color, className, style }) {
5+
export default function Facebook({ color, className, style, size }) {
66
const circles = [...Array(3)].map((_, index) => <div key={index} style={{ background: `${color}` }}></div>)
77

88
return (
9-
<div className={`lds-facebook ${className}`} style={{ ...style }}>
9+
<div className={`lds-facebook ${className}`} style={{ width: size, height: size, ...style }}>
1010
{circles}
1111
</div>
1212
)
@@ -19,10 +19,13 @@ Facebook.propTypes = {
1919
className: PropTypes.string,
2020
/** style object */
2121
style: PropTypes.object,
22+
/** size in pixel */
23+
size: PropTypes.number,
2224
}
2325

2426
Facebook.defaultProps = {
2527
color: '#7f58af',
2628
className: '',
2729
style: {},
30+
size: 80,
2831
}

src/components/Facebook/style.css

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,30 @@
77
.lds-facebook div {
88
display: inline-block;
99
position: absolute;
10-
left: 8px;
11-
width: 16px;
10+
left: 10%;
11+
width: 20%;
1212
background: #fff;
1313
animation: lds-facebook 1.2s cubic-bezier(0, 0.5, 0.5, 1) infinite;
1414
}
1515
.lds-facebook div:nth-child(1) {
16-
left: 8px;
16+
left: 10%;
1717
animation-delay: -0.24s;
1818
}
1919
.lds-facebook div:nth-child(2) {
20-
left: 32px;
20+
left: 40%;
2121
animation-delay: -0.12s;
2222
}
2323
.lds-facebook div:nth-child(3) {
24-
left: 56px;
24+
left: 70%;
2525
animation-delay: 0;
2626
}
2727
@keyframes lds-facebook {
2828
0% {
29-
top: 8px;
30-
height: 64px;
29+
top: 10%;
30+
height: 80%;
3131
}
3232
50%, 100% {
33-
top: 24px;
34-
height: 32px;
33+
top: 30%;
34+
height: 40%;
3535
}
36-
}
36+
}

src/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@ const SizeProp = () => {
143143
<Heart color="#be97e8" size={20} />
144144
</div>
145145
<div className="block">
146+
<Facebook color="#be97e8" />
147+
<Facebook color="#be97e8" size={40} />
148+
<Facebook color="#be97e8" size={20} />
149+
</div>
150+
<div className="block">
146151
<Ripple color="#be97e8" />
147152
<Ripple color="#be97e8" size={40} />
148153
<Ripple color="#be97e8" size={20} />

0 commit comments

Comments
 (0)