1
0
mirror of https://github.com/phuoc-ng/csslayout.git synced 2025-08-10 16:14:19 +02:00

Add sidebar layout

This commit is contained in:
Phuoc Nguyen
2019-11-16 11:14:31 +07:00
parent 254ba0b4b6
commit b8e8aff61c
11 changed files with 140 additions and 8 deletions

View File

@@ -0,0 +1,23 @@
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;

View File

@@ -1,12 +1,10 @@
import React from 'react';
const Line = ({ size }) => {
const h = (size === 'medium' ? '2px' : '1px');
const Line = () => {
return (
<div
className="w-100 bg-black-30"
style={{ height: h }}
style={{ height: '1px' }}
/>
);
};

View File

@@ -0,0 +1,12 @@
import React from 'react';
const Rectangle = ({ height }) => {
return (
<div
className="w-100 bg-black-30 br-pill"
style={{ height: `${height}px` }}
/>
);
};
export default Rectangle;