Container: Updated id format + add feedback for the selected container

This commit is contained in:
Siklos 2022-08-01 11:11:07 +02:00
parent 893b525d45
commit 94c9ac26c0
2 changed files with 8 additions and 2 deletions

View file

@ -102,7 +102,7 @@ class App extends React.Component<IAppProps> {
const depth: number = Container.getDepth(parent) + 1;
const container = new Container({
parent,
id: `${depth}-${parent.props.children.length.toString()}`,
id: `${type}-${depth}-${parent.props.children.length.toString()}`,
x: 0,
y: 0,
width: properties?.Width,
@ -135,6 +135,7 @@ class App extends React.Component<IAppProps> {
<button className='fixed z-10 top-4 left-4 text-lg bg-blue-200 hover:bg-blue-300 transition-all drop-shadow-md hover:drop-shadow-lg py-2 px-3 rounded-lg' onClick={() => this.ToggleSidebar()}>&#9776; Menu</button>
<SVGSidebar
MainContainer={this.state.MainContainer}
SelectedContainer={this.state.SelectedContainer}
isOpen={this.state.isSVGSidebarOpen}
onClick={() => this.ToggleSVGSidebar()}
selectContainer={(container: Container) => this.SelectContainer(container)}