UNPKG

@csegames/camelot-unchained

Version:

Camelot Unchained Client Library

38 lines (37 loc) 1.58 kB
"use strict"; /* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var __assign = undefined && undefined.__assign || Object.assign || function (t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) { if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } } return t; }; Object.defineProperty(exports, "__esModule", { value: true }); var React = require("react"); var aphrodite_1 = require("aphrodite"); var moment = require("moment"); var Card_1 = require("./Card"); var Card_2 = require("./Card"); exports.CardLevel = Card_2.CardLevel; exports.defaultTitleCardStyle = __assign({}, Card_1.defaultCardStyle, { title: { fontSize: '1.2em', color: '#AAA', width: '100%' }, date: { fontSize: '0.8em', color: '#777', textAlign: 'right' } }); exports.TitleCard = function (props) { var ss = aphrodite_1.StyleSheet.create(exports.defaultTitleCardStyle); var custom = aphrodite_1.StyleSheet.create(props.styles || {}); return React.createElement(Card_1.default, __assign({}, props), React.createElement("div", { className: aphrodite_1.css(ss.title, custom.title) }, props.title), props.children, props.date ? React.createElement("div", { className: aphrodite_1.css(ss.date, custom.date) }, moment(props.date).fromNow()) : null); }; exports.default = exports.TitleCard;