@bigfishtv/cockpit
Version:
67 lines (56 loc) • 2.18 kB
JavaScript
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; }
import React, { Component } from 'react';
import RadioButtonGroup from '../input/RadioButtonGroupInput';
import DateTimeInput from '../input/DateTimeInput';
var deviceWidths = [{
text: 'XS',
value: 375
}, {
text: 'S',
value: 768
}, {
text: 'M',
value: 1024
}, {
text: 'L',
value: 1280
}, {
text: 'XL',
value: 1680
}, {
text: 'Auto',
value: '100%'
}];
var PreviewToolbar = function (_Component) {
_inherits(PreviewToolbar, _Component);
function PreviewToolbar() {
_classCallCheck(this, PreviewToolbar);
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
}
PreviewToolbar.prototype.render = function render() {
return React.createElement(
'div',
{ className: 'preview-toolbar' },
React.createElement(
'label',
{ className: 'preview-toolbar-label' },
'Device Width'
),
React.createElement(RadioButtonGroup, {
options: deviceWidths,
value: this.props.deviceWidth,
onChange: this.props.onDeviceWidthChange
}),
React.createElement(
'label',
{ className: 'preview-toolbar-label' },
'Date'
),
React.createElement(DateTimeInput, { value: this.props.date, onChange: this.props.onDateChange })
);
};
return PreviewToolbar;
}(Component);
export { PreviewToolbar as default };