1
0
mirror of https://github.com/phuoc-ng/csslayout.git synced 2025-08-06 22:26:33 +02:00

Block supports justify

This commit is contained in:
Phuoc Nguyen
2019-11-22 18:27:44 +07:00
parent 370ad06c88
commit 92555e70c3

View File

@@ -1,11 +1,10 @@
import React from 'react'; import React from 'react';
import random from '../helpers/random'; import random from '../helpers/random';
import Rectangle from './Rectangle';
const Block = ({ numberOfBlocks }) => { const Block = ({ justify = 'start', numberOfBlocks }) => {
return ( return (
<div className="flex flex-wrap w-100"> <div className={`flex flex-wrap w-100 justify-${justify}`}>
{ {
Array(numberOfBlocks).fill(0).map((_, i) => { Array(numberOfBlocks).fill(0).map((_, i) => {
const s = random(1, 5); const s = random(1, 5);