mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-04 15:11:10 +08:00
67 lines
1.4 KiB
JavaScript
67 lines
1.4 KiB
JavaScript
'use strict';
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
|
|
var _react = require('react');
|
|
|
|
var _react2 = _interopRequireDefault(_react);
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
var mainStyle = {
|
|
position: 'fixed',
|
|
top: 0, bottom: 0, left: 0, right: 0,
|
|
padding: 20,
|
|
backgroundColor: 'rgb(187, 49, 49)',
|
|
color: '#FFF',
|
|
fontFamily: '\n -apple-system, ".SFNSText-Regular", "San Francisco", Roboto, "Segoe UI",\n "Helvetica Neue", "Lucida Grande", sans-serif\'\n '
|
|
};
|
|
|
|
var headingStyle = {
|
|
fontFamily: 'inherit',
|
|
fontSize: 20,
|
|
fontWeight: 600,
|
|
letterSpacing: 'normal',
|
|
margin: '10px 0'
|
|
};
|
|
|
|
var codeStyle = {
|
|
fontSize: 14,
|
|
width: '100vw',
|
|
overflow: 'auto'
|
|
};
|
|
|
|
var ErrorDisplay = function ErrorDisplay(_ref) {
|
|
var error = _ref.error;
|
|
return _react2.default.createElement(
|
|
'div',
|
|
{ style: mainStyle, __self: undefined
|
|
},
|
|
_react2.default.createElement(
|
|
'div',
|
|
{ style: headingStyle, __self: undefined
|
|
},
|
|
error.message
|
|
),
|
|
_react2.default.createElement(
|
|
'pre',
|
|
{ style: codeStyle, __self: undefined
|
|
},
|
|
_react2.default.createElement(
|
|
'code',
|
|
{
|
|
__self: undefined
|
|
},
|
|
error.stack
|
|
)
|
|
)
|
|
);
|
|
};
|
|
|
|
ErrorDisplay.propTypes = {
|
|
error: _react2.default.PropTypes.object.isRequired
|
|
};
|
|
|
|
exports.default = ErrorDisplay; |