UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

32 lines (30 loc) 1.3 kB
"use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var React = require('react'); var css_1 = require('../../utilities/css'); require('./DocumentCard.scss'); var DocumentCard = (function (_super) { __extends(DocumentCard, _super); function DocumentCard() { _super.apply(this, arguments); } DocumentCard.prototype.render = function () { var _a = this.props, onClick = _a.onClick, onClickHref = _a.onClickHref, children = _a.children, className = _a.className; // If no onClickFunction was provided and we do have an onClickURL, create a function from it. if (!onClick && onClickHref) { onClick = function () { window.location.href = onClickHref; }; } return (React.createElement("div", {className: css_1.css('ms-DocumentCard', { 'ms-DocumentCard--actionable': onClick ? true : false }, className), onClick: onClick}, children)); }; return DocumentCard; }(React.Component)); exports.DocumentCard = DocumentCard; //# sourceMappingURL=DocumentCard.js.map