render()

in modules/monochrome/src/float-panel/index.js [232:277]


  render() {
    const {
      theme,
      style,
      title,
      x,
      y,
      width,
      height,
      className,
      parentWidth,
      parentHeight
    } = this.props;
    const {isMoving, isResizing} = this.state;

    const styleProps = {
      theme,
      isMoving,
      isResizing
    };

    const wrapperStyle = {
      left: Math.min(x, Math.max(0, parentWidth - width)),
      top: Math.min(y, Math.max(0, parentHeight - height)),
      width
    };

    // Only title bar is draggable
    return (
      <Container
        className={className}
        {...styleProps}
        userStyle={style.wrapper}
        style={wrapperStyle}
      >
        {title
          ? this.renderMover(
              <TitleComponent {...styleProps} userStyle={style.title}>
                {title}
              </TitleComponent>
            )
          : this.renderMover(this.renderContent(styleProps))}
        {title && this.renderContent(styleProps)}
      </Container>
    );
  }