Refactor Simulations component layout: streamline event handling and add comparison functionality
This commit is contained in:
@@ -153,54 +153,73 @@ const Simulations: React.FC = () => {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{products.length > 1 && (
|
{products.length > 1 && (
|
||||||
<>
|
<div
|
||||||
<div
|
className="remove-button"
|
||||||
className="remove-button"
|
onClick={() => handleRemoveProduct(product.productId)}
|
||||||
onClick={() => handleRemoveProduct(product.productId)}
|
>
|
||||||
>
|
<RemoveIcon />
|
||||||
<RemoveIcon />
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="simulation-process section">
|
|
||||||
<button
|
|
||||||
className="collapse-header-container"
|
|
||||||
onClick={() => setOpenObjects(!openObjects)}
|
|
||||||
>
|
|
||||||
<div className="header">Events</div>
|
|
||||||
<div className="arrow-container">
|
|
||||||
<ArrowIcon />
|
|
||||||
</div>
|
|
||||||
</button>
|
|
||||||
{openObjects && events.map((event, index) => <List key={index} val={event} />)}
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{selectedAsset && (
|
|
||||||
<RenderOverlay>
|
|
||||||
<EditWidgetOption
|
|
||||||
options={["Add to Product", "Remove from Product"]}
|
|
||||||
onClick={(option) => {
|
|
||||||
if (option === "Add to Product") {
|
|
||||||
handleAddEventToProduct({
|
|
||||||
event: getEventByModelUuid(selectedAsset.modelUuid),
|
|
||||||
addEvent,
|
|
||||||
selectedProduct,
|
|
||||||
clearSelectedAsset
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
handleRemoveEventFromProduct();
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</RenderOverlay>
|
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
<div
|
||||||
|
className="resize-icon"
|
||||||
|
id="action-resize"
|
||||||
|
onMouseDown={(e) => handleResize(e, productsContainerRef)}
|
||||||
|
>
|
||||||
|
<ResizeHeightIcon />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="simulation-process section">
|
||||||
|
<button
|
||||||
|
className="collapse-header-container"
|
||||||
|
onClick={() => setOpenObjects(!openObjects)}
|
||||||
|
>
|
||||||
|
<div className="header">Events</div>
|
||||||
|
<div className="arrow-container">
|
||||||
|
<ArrowIcon />
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
|
{openObjects &&
|
||||||
|
events.map((event, index) => <List key={index} val={event} />)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="compare-simulations-container">
|
||||||
|
<div className="compare-simulations-header">
|
||||||
|
Need to Compare Layout?
|
||||||
|
</div>
|
||||||
|
<div className="content">
|
||||||
|
Click <span>'Compare'</span> to review and analyze the layout
|
||||||
|
differences between them.
|
||||||
|
</div>
|
||||||
|
<div className="input">
|
||||||
|
<input type="button" value={"Compare"} className="submit" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{selectedAsset && (
|
||||||
|
<RenderOverlay>
|
||||||
|
<EditWidgetOption
|
||||||
|
options={["Add to Product", "Remove from Product"]}
|
||||||
|
onClick={(option) => {
|
||||||
|
if (option === "Add to Product") {
|
||||||
|
handleAddEventToProduct({
|
||||||
|
event: getEventByModelUuid(selectedAsset.modelUuid),
|
||||||
|
addEvent,
|
||||||
|
selectedProduct,
|
||||||
|
clearSelectedAsset
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
handleRemoveEventFromProduct();
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</RenderOverlay>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user