Sha256: 8e4fbe8d886d0fcac4684957cf0c3a8cf60e8036010af7d63326280efd0829e1

Contents?: true

Size: 933 Bytes

Versions: 5

Compression:

Stored size: 933 Bytes

Contents

class ResourcePreview extends React.Component {
  constructor(props) {
    super(props);
    this.hOffset = 30;
  }

  render() {
    const props = this.props;
    let styles;
    if (props.isHovering) {
      let $anchorDims = Foundation.Box.GetDimensions(props.anchor);
      styles = { left: $anchorDims.offset.left + $anchorDims.width + this.hOffset,
                 top: $anchorDims.offset.top
                };
    }
    const cssStyles = classNames( 'dropdown-pane', 'o-resource__preview',
                                 { 'is-open': props.isHovering });
    const previewTitle = `${_.capitalize(props.resource.short_title)} - ${props.resource.title}`;

    return (
      <div className={cssStyles} style={styles}>
        <div className='u-txt--resource-preview-title'>
          {previewTitle}
        </div>
        <div className='u-txt--resource-preview-body'>{props.resource.teaser}</div>
      </div>
    );
  }
}

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
lcms-engine-0.1.4 app/assets/javascripts/lcms/engine/components/curriculum-map/ResourcePreview.js.jsx
lcms-engine-0.1.3 app/assets/javascripts/lcms/engine/components/curriculum-map/ResourcePreview.js.jsx
lcms-engine-0.2.0 app/assets/javascripts/lcms/engine/components/curriculum-map/ResourcePreview.js.jsx
lcms-engine-0.1.2 app/assets/javascripts/lcms/engine/components/curriculum-map/ResourcePreview.js.jsx
lcms-engine-0.1.0 app/assets/javascripts/lcms/engine/components/curriculum-map/ResourcePreview.js.jsx