2019-02-10 13:06:05 +00:00
|
|
|
import * as React from "react"
|
|
|
|
|
import BaseComponent, { IComponentProps } from "./BaseComponent"
|
|
|
|
|
import { ContainerOrientation } from "../constants/WidgetConstants"
|
2019-02-10 15:06:57 +00:00
|
|
|
import styled from "../constants/DefaultTheme"
|
2019-02-10 13:06:05 +00:00
|
|
|
|
|
|
|
|
const Container = styled.div`
|
2019-02-10 15:06:57 +00:00
|
|
|
background: ${props => props.theme.primaryColor};
|
2019-02-10 14:14:58 +00:00
|
|
|
color: "black";
|
2019-02-10 13:06:05 +00:00
|
|
|
`
|
|
|
|
|
|
|
|
|
|
class ContainerComponent extends BaseComponent<IContainerProps> {
|
|
|
|
|
render() {
|
|
|
|
|
return (
|
2019-02-10 15:06:57 +00:00
|
|
|
<Container key={this.componentData.widgetId}>
|
2019-02-10 13:06:05 +00:00
|
|
|
{this.props.children
|
|
|
|
|
? this.props.children.map(child => {
|
|
|
|
|
return child
|
|
|
|
|
})
|
|
|
|
|
: undefined}
|
|
|
|
|
</Container>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IContainerProps extends IComponentProps {
|
|
|
|
|
children?: React.Component[]
|
2019-02-10 14:14:58 +00:00
|
|
|
snapColumnSpace?: number
|
|
|
|
|
snapRowSpace?: number
|
|
|
|
|
snapColumns?: number
|
|
|
|
|
snapRows?: number
|
|
|
|
|
orientation?: ContainerOrientation
|
2019-02-10 13:06:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default ContainerComponent
|