1
0
mirror of https://github.com/phuoc-ng/csslayout.git synced 2025-10-22 10:16:08 +02:00
Files
csslayout/client/placeholders/Block.jsx
2019-11-23 21:02:28 +07:00

23 lines
699 B
JavaScript

import React from 'react';
import random from '../helpers/random';
const Block = ({ justify = 'start', numberOfBlocks = 1, blockHeight = 4 }) => {
return (
<div className={`flex flex-wrap w-100 justify-${justify}`}>
{
Array(numberOfBlocks).fill(0).map((_, i) => {
const s = random(1, 5);
return (
<div key={i} className={`mr2 mb2 w-${s * 10}`}>
<div className="w-100 bg-black-30 br-pill" style={{ height: `${blockHeight}px` }} />
</div>
);
})
}
</div>
);
};
export default Block;