mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 09:28:31 +00:00
* Hide Apps tab for Admin * Made users tab active is apps is not visible * Add loading for groups, fix format issues Co-authored-by: Dmytro Danylov <icdmytro.danylov@americanwell.com>
55 lines
1.5 KiB
JavaScript
55 lines
1.5 KiB
JavaScript
import React, { useRef } from 'react';
|
|
import { SubCustomDragLayer } from '../SubCustomDragLayer';
|
|
import { SubContainer } from '../SubContainer';
|
|
|
|
export const Container = function Container({
|
|
id,
|
|
component,
|
|
width,
|
|
height,
|
|
containerProps,
|
|
removeComponent,
|
|
styles,
|
|
darkMode,
|
|
}) {
|
|
const { visibility, disabledState, borderRadius, borderColor } = styles;
|
|
const backgroundColor =
|
|
['#fff', '#ffffffff'].includes(styles.backgroundColor) && darkMode ? '#232E3C' : styles.backgroundColor;
|
|
const computedStyles = {
|
|
backgroundColor,
|
|
borderRadius: borderRadius ? parseFloat(borderRadius) : 0,
|
|
border: `1px solid ${borderColor}`,
|
|
height,
|
|
display: visibility ? 'flex' : 'none',
|
|
};
|
|
|
|
const parentRef = useRef(null);
|
|
|
|
return (
|
|
<div
|
|
data-disabled={disabledState}
|
|
className="jet-container"
|
|
id={id}
|
|
ref={parentRef}
|
|
style={computedStyles}
|
|
onClick={(e) => {
|
|
if (e.target.className === 'real-canvas') containerProps.onComponentClick(id, component);
|
|
}} //Hack, should find a better solution - to prevent losing z index when container element is clicked
|
|
>
|
|
<SubContainer
|
|
parentComponent={component}
|
|
containerCanvasWidth={width}
|
|
parent={id}
|
|
{...containerProps}
|
|
parentRef={parentRef}
|
|
removeComponent={removeComponent}
|
|
/>
|
|
<SubCustomDragLayer
|
|
containerCanvasWidth={width}
|
|
parent={id}
|
|
parentRef={parentRef}
|
|
currentLayout={containerProps.currentLayout}
|
|
/>
|
|
</div>
|
|
);
|
|
};
|