Move SVG folder to Components

This commit is contained in:
Siklos 2022-07-31 19:13:52 +02:00
parent aa33ab4019
commit 90dac41a04
4 changed files with 3 additions and 3 deletions

View file

@ -0,0 +1,35 @@
import * as React from 'react';
interface IContainerProps {
id: string,
// eslint-disable-next-line no-use-before-define
children: Container[],
x: number,
y: number,
width: number,
height: number,
style?: React.CSSProperties,
}
export class Container extends React.Component<IContainerProps> {
componentWillUnMount() {
}
public render(): React.ReactNode {
const containersElements = this.props.children.map(child => child.render());
return (
<g
transform={`translate(${this.props.x}, ${this.props.y})`}
key={`container-${this.props.id}`}
>
<rect
width={this.props.width}
height={this.props.height}
style={this.props.style}
>
</rect>
{ containersElements }
</g>
);
}
}