UNPKG

graft-react

Version:

react admin and helper components for graft-db

36 lines (35 loc) 1.73 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 __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var React = require("react"); var Media_1 = require("react-md/lib/Media/Media"); var WithSrc_1 = require("./WithSrc"); var Media = (function (_super) { __extends(Media, _super); function Media() { return _super !== null && _super.apply(this, arguments) || this; } Media.prototype.render = function () { var _a = this.props, src = _a.src, aspectRatio = _a.aspectRatio; return (React.createElement("div", { className: 'md-cell md-cell--4' }, React.createElement(Media_1.default, { aspectRatio: aspectRatio || '16-9', style: { backgroundImage: "url(" + src + ")", backgroundSize: 'cover', backgroundPosition: 'center center', } }))); }; return Media; }(React.Component)); Media = __decorate([ WithSrc_1.WithSrc ], Media); exports.Media = Media;