Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
renderModal(manager) {
const {
children, disclosureAccessory, withDisclosureContainer, ...customProps
} = this.props;
const containerClassNames = cx([
'container',
customProps.className,
]);
const classArray = ['modal-manager'];
const isFullscreen = manager.disclosure.isMaximized || manager.disclosure.size === availableDisclosureSizes.FULLSCREEN;
if (!isFullscreen) {
if (manager.disclosure.dimensions) {
classArray.push(`height-${manager.disclosure.dimensions.height}`, `width-${manager.disclosure.dimensions.width}`);
} else if (manager.disclosure.size) {
classArray.push(`height-${heightFromSize[manager.disclosure.size]}`, `width-${widthFromSize[manager.disclosure.size]}`);
}
}
const presentedDisclosureComponentKey = manager.disclosureComponentKeys[manager.disclosureComponentKeys.length - 1];
const presentedDisclosureComponentData = manager.disclosureComponentData[presentedDisclosureComponentKey] || {};
const headerDataForPresentedComponent = presentedDisclosureComponentData.headerAdapterData;
return (
<div>
{manager.children.components}
</div>
renderModal(manager) {
const { children, ...customProps } = this.props;
const topComponentKey = manager.disclosureComponentKeys[manager.disclosureComponentKeys.length - 1];
const topComponentData = manager.disclosureComponentData[topComponentKey] || {};
const headerDataForDisclosedComponent = topComponentData.headerAdapter || {};
const containerClassNames = cx([
'container',
customProps.className,
]);
const classArray = ['modal-manager'];
const isFullscreen = manager.minimizeDisclosure || topComponentData.size === availableDisclosureSizes.FULLSCREEN;
if (!isFullscreen) {
if (typeof topComponentData.size === 'object') {
classArray.push(`height-${topComponentData.size.height}`, `width-${topComponentData.size.width}`);
} else if (typeof topComponentData.size === 'string') {
classArray.push(`height-${heightFromSize[topComponentData.size]}`, `width-${widthFromSize[topComponentData.size]}`);
}
}
return (
<div>
{manager.wrappedChildren}
{</div>
renderSlidePanel(manager) {
const {
children, panelBehavior, disclosureAccessory, withDisclosureContainer, ...customProps
} = this.props;
let isFullscreen;
if (manager.disclosure.size === availableDisclosureSizes.FULLSCREEN || manager.disclosure.isMaximized) {
isFullscreen = true;
}
let panelSize;
if (manager.disclosure.dimensions) {
panelSize = disclosureDimensionsToPanelSize(manager.disclosure.dimensions);
} else {
panelSize = disclosureSizeToPanelSize[manager.disclosure.size];
}
const presentedDisclosureComponentKey = manager.disclosureComponentKeys[manager.disclosureComponentKeys.length - 1];
const presentedDisclosureComponentData = manager.disclosureComponentData[presentedDisclosureComponentKey] || {};
const headerDataForPresentedComponent = presentedDisclosureComponentData.headerAdapterData;
return (