Skip to content
Permalink
Browse files

Render Containers and Contentlets

  • Loading branch information...
fmontes committed Feb 27, 2019
1 parent 8b25c82 commit 9b817e8bde15ef180d7a455aef7eb80aa28205c3
Showing with 25 additions and 3 deletions.
  1. +9 −2 src/components/Column.js
  2. +8 −0 src/components/Container.js
  3. +7 −0 src/components/Contentlet.js
  4. +1 −1 src/utils/index.js
@@ -1,8 +1,15 @@
import React from 'react';
import { Col as BtColumn } from 'reactstrap';
import Container from './Container';

const Column = (props) => {
return <BtColumn sm={props.width}><h3>I'm a Column</h3></BtColumn>;
const Column = props => {
return (
<BtColumn sm={props.width}>
{props.containers.map((container, i) => (
<Container key={i} {...container} />
))}
</BtColumn>
);
};

export default Column;
@@ -0,0 +1,8 @@
import React from 'react';
import Contentlet from './Contentlet';

const Container = (props) => {
return props.contentlets.map((contentlet, i) => <Contentlet key={i} {...contentlet} />);
};

export default Container;
@@ -0,0 +1,7 @@
import React from 'react';

const Contentlet = (props) => {
return <h3>I'm a Contentlet</h3>;
};
export default Contentlet;
@@ -3,7 +3,7 @@ function getFullContainers(column, containers) {
const fullContainer = containers[container.identifier];
return {
...fullContainer.container,
contentlets: fullContainer.contentlets
contentlets: fullContainer.contentlets[`uuid-${container.uuid}`]
};
});
};

0 comments on commit 9b817e8

Please sign in to comment.
You can’t perform that action at this time.