quesbook-component
Version:
159 lines (139 loc) • 6.95 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _RateStar = require('../common/RateStar');
var _RateStar2 = _interopRequireDefault(_RateStar);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**
* Created by az on 2017/7/28.
*/
/*eslint-disable*/
var QbCard = function (_Component) {
_inherits(QbCard, _Component);
function QbCard() {
_classCallCheck(this, QbCard);
return _possibleConstructorReturn(this, (QbCard.__proto__ || Object.getPrototypeOf(QbCard)).apply(this, arguments));
}
_createClass(QbCard, [{
key: 'render',
value: function render() {
var _props = this.props,
cardStyle = _props.cardStyle,
avatarSrc = _props.avatarSrc,
rate = _props.rate;
return _react2.default.createElement(
'div',
{ style: _extends({}, style.card, cardStyle) },
_react2.default.createElement(
'div',
{ style: style.leftFrame },
_react2.default.createElement('img', { src: avatarSrc })
),
_react2.default.createElement(
'div',
{ style: style.rightFrame },
_react2.default.createElement(
'div',
{ style: style.classTitle },
'asdasmd koamo kmo jm osdjonqc dqwj dncpian apdijcn pdj pfidf n'
),
_react2.default.createElement(
'div',
{ style: style.priceAndTime },
_react2.default.createElement(
'div',
{ style: style.time },
'120912321'
),
_react2.default.createElement(
'div',
{ style: style.price },
'$666'
)
),
_react2.default.createElement(
'div',
{ style: style.ratingAndName },
_react2.default.createElement(
'div',
{ style: style.tutorName },
'asda joisdd'
),
_react2.default.createElement(
'div',
{ style: style.rating },
_react2.default.createElement(_RateStar2.default, { rate: rate * 20 })
)
)
)
);
}
}]);
return QbCard;
}(_react.Component);
var style = {
card: {
display: 'flex',
flexDirection: 'row',
borderRadius: 4,
boxShadow: '0 2px 20px 0 rgba(25, 34, 48, 0.27)'
},
leftFrame: {
height: '100%',
width: 68,
border: 0
},
rightFrame: {
flex: 1,
display: 'flex',
flexDirection: 'column',
padding: '9px 15px 9px 12px'
},
classTitle: {
fontFamily: 'GothamNarrow',
fontSize: 21,
fontWeight: 'bold',
lineHeight: 1.2,
color: '#192230'
},
priceAndTime: {
display: 'flex',
flexDirection: 'row'
},
price: {
fontFamily: 'Gotham-Book',
fontSize: 14.4,
lineHeight: 1.5,
color: '#5d90e3',
marginLeft: 10
},
time: {
fontFamily: 'Gotham-Book',
fontSize: 14.4,
lineHeight: 1.5,
color: '#5d90e3'
},
ratingAndName: {
display: 'flex',
flexDirection: 'row',
alignItems: 'center'
},
rating: {
marginLeft: 10
},
tutorName: {
fontFamily: 'Gotham-Book',
fontSize: 14.4,
lineHeight: 1.5,
color: '#192230'
}
};
exports.default = QbCard;
//# sourceMappingURL=QbCard.js.map