Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import * as React from 'react';
import { WithStore } from '../store';
import * as Types from '@meetalva/types';
export interface AppPaneProps {
pane: Types.AppPane;
force?: boolean;
children: React.ReactNode;
size?: { width: number | string; height: number | string };
defaultSize?: { width: number | string; height: number | string };
enable?: { top?: boolean; right?: boolean; bottom?: boolean; left?: boolean };
minWidth?: number;
minHeight?: number;
}
const Resizeable = require('re-resizable').default;
@MobxReact.inject('store')
@MobxReact.observer
export class AppPane extends React.Component {
public render(): JSX.Element | null {
const props = this.props as AppPaneProps & WithStore;
const app = props.store.getApp();
if (!props.force && !app.isVisible(props.pane)) {
return null;
}
const paneSize = props.size || props.pane ? app.getPaneSize(props.pane) : undefined;
const defaultSize = paneSize
? { width: paneSize.width, height: paneSize.height }