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

Support size

This commit is contained in:
Phuoc Nguyen
2021-04-03 12:32:23 +07:00
parent 8d1041ad9b
commit 3b93e2d3b7

View File

@@ -7,20 +7,20 @@ import * as React from 'react';
interface SquareProps { interface SquareProps {
backgroundColor?: string; backgroundColor?: string;
size?: number; size?: string;
} }
const Square: React.FC<SquareProps> = ({ const Square: React.FC<SquareProps> = ({
backgroundColor = 'rgba(0, 0, 0, 0.3)', backgroundColor = 'rgba(0, 0, 0, 0.3)',
size = 8, size = '100%',
}) => { }) => {
return ( return (
<div <div
style={{ style={{
backgroundColor, backgroundColor,
borderRadius: '4px', borderRadius: '0.25rem',
height: '100%', height: size,
width: '100%', width: size,
}} }}
/> />
); );