mirror of
https://github.com/phuoc-ng/csslayout.git
synced 2025-10-23 02:36:11 +02:00
24 lines
615 B
JavaScript
24 lines
615 B
JavaScript
import React from 'react';
|
|
|
|
import random from '../helpers/random';
|
|
import Rectangle from './Rectangle';
|
|
|
|
const Block = ({ numberOfBlocks }) => {
|
|
return (
|
|
<div className="flex flex-wrap w-100">
|
|
{
|
|
Array(numberOfBlocks).fill(0).map((_, i) => {
|
|
const s = random(1, 5);
|
|
return (
|
|
<div key={i} className={`mr2 mb2 w-${s * 10}`}>
|
|
<Rectangle height={8} />
|
|
</div>
|
|
);
|
|
})
|
|
}
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default Block;
|