Add style to Main Container

This commit is contained in:
Hydroxycarbamide 2022-07-30 23:56:03 +02:00
parent ed5d2daed8
commit 58ec891db3
3 changed files with 16 additions and 10 deletions

View file

@ -5,19 +5,19 @@ interface IContainerProps {
y: number,
width: number,
height: number,
style: React.CSSProperties,
}
export class Container extends React.Component<IContainerProps> {
public render() {
const properties = {
x: this.props.x,
y: this.props.y,
width: this.props.width,
height: this.props.height
};
return (
<rect {...properties} />
<rect
x={this.props.x}
y={this.props.y}
width={this.props.width}
height={this.props.height}
style={this.props.style}
/>
);
}
}

View file

@ -8,12 +8,18 @@ interface IMainContainerProps {
export class MainContainer extends React.Component<IMainContainerProps> {
public render() {
const style: React.CSSProperties = {
fillOpacity: 0,
stroke: 'black'
};
return (
<Container
x={0}
y={0}
width={this.props.width}
height={this.props.height}
style={style}
/>
);
}

View file

@ -22,8 +22,8 @@ serve({
MainContainer: {
Type: 'Trou',
BorderColor: '#ffffff',
Height: 1600,
Width: 20000
Height: 300,
Width: 2000
}
}
);