Move SVG folder to Components
This commit is contained in:
parent
aa33ab4019
commit
90dac41a04
4 changed files with 3 additions and 3 deletions
35
src/Components/SVG/Elements/Container.tsx
Normal file
35
src/Components/SVG/Elements/Container.tsx
Normal 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>
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue