parent
f897e728a5
commit
a3ae1a515c
5 changed files with 76 additions and 38 deletions
@ -0,0 +1,44 @@ |
||||
import React from "react"; |
||||
|
||||
const Design2D = ({ array }) => { |
||||
return ( |
||||
<section className="flex items-center justify-around bg-white h-60"> |
||||
{array.map((item, index) => ( |
||||
<div |
||||
className={`flex flex-col h-full`} |
||||
style={{ flex: item.flex }} |
||||
key={index} |
||||
> |
||||
{item.items.map((item1, index) => ( |
||||
<div |
||||
className={`flex ${item1.bg}`} |
||||
style={{ flex: item1.flex }} |
||||
></div> |
||||
))} |
||||
</div> |
||||
))} |
||||
</section> |
||||
); |
||||
}; |
||||
|
||||
export default Design2D; |
||||
|
||||
Design2D.defaultProps = { |
||||
array: [ |
||||
{ |
||||
flex: 6, |
||||
items: [{ bg: "bg-red-500", flex: 1 }], |
||||
}, |
||||
{ |
||||
flex: 4, |
||||
items: [{ bg: "bg-green-500", flex: 1 }], |
||||
}, |
||||
{ |
||||
flex: 2, |
||||
items: [ |
||||
{ bg: "bg-blue-500", flex: 1 }, |
||||
{ bg: "bg-yellow-500", flex: 1 }, |
||||
], |
||||
}, |
||||
], |
||||
}; |
Loading…
Reference in new issue