UNPKG

@up-group/react-controls

Version:

We know that there are a ton of react UI library projects to choose from. Our hope with this one is to provide the next generation of react components that you can use to bootstrap your next project, or as a reference for building a UIKit. Read on to get

40 lines 1.76 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var React = require("react"); var TodayLine = (function (_super) { __extends(TodayLine, _super); function TodayLine() { return _super !== null && _super.apply(this, arguments) || this; } TodayLine.prototype.render = function () { var currentTime = new Date().getTime(); if (currentTime > this.props.canvasTimeStart && currentTime < this.props.canvasTimeEnd) { var ratio = this.props.canvasWidth / (this.props.canvasTimeEnd - this.props.canvasTimeStart); var left = Math.round((currentTime - this.props.canvasTimeStart) * ratio); var top_1 = this.props.headerHeight; var height = this.props.height - this.props.headerHeight; var styles = { top: top_1 + "px", left: left + "px", height: height + "px" }; return React.createElement("div", { className: 'rct-today', style: styles }); } else { return React.createElement("div", null); } }; return TodayLine; }(React.Component)); exports.default = TodayLine; //# sourceMappingURL=TodayLine.js.map