UNPKG

react-landing-page

Version:

[![Demo](https://user-images.githubusercontent.com/2906365/43375514-94cfb9ae-9383-11e8-9489-cffe5212fd2e.png)](https://hermanya.github.io/react-landing-page/)

90 lines (77 loc) 2.91 kB
'use strict'; 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 _react = require('react'); var _react2 = _interopRequireDefault(_react); var _rebass = require('rebass'); var _propTypes = require('prop-types'); var _propTypes2 = _interopRequireDefault(_propTypes); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } var Testimony = function Testimony(_ref) { var authorAvatar = _ref.authorAvatar, authorName = _ref.authorName, authorTitle = _ref.authorTitle, children = _ref.children, bubbleBg = _ref.bubbleBg, bubbleColor = _ref.bubbleColor, props = _objectWithoutProperties(_ref, ['authorAvatar', 'authorName', 'authorTitle', 'children', 'bubbleBg', 'bubbleColor']); return _react2.default.createElement( _rebass.Flex, _extends({ flexDirection: 'column', alignItems: 'center' }, props), typeof children === 'string' ? _react2.default.createElement( _rebass.Relative, null, _react2.default.createElement( _rebass.Blockquote, { bg: bubbleBg, color: bubbleColor, mb: 3, p: 3 }, children, _react2.default.createElement( _rebass.Absolute, { bottom: 4, left: 24 }, _react2.default.createElement(_rebass.Arrow, { color: bubbleBg }) ) ) ) : children, _react2.default.createElement( _rebass.Flex, { alignItems: 'center', width: 1 }, _react2.default.createElement(_rebass.Avatar, { src: authorAvatar, size: 64, mr: 3, alt: '' }), _react2.default.createElement( _rebass.Box, null, _react2.default.createElement( _rebass.Lead, null, authorName ), _react2.default.createElement( _rebass.Text, { style: { opacity: 3 / 4 } }, authorTitle ) ) ) ); }; Testimony.defaultProps = { authorAvatar: 'https://via.placeholder.com/64x64', authorName: 'Anonymous', authorTitle: 'expert', bubbleBg: 'whitesmoke', bubbleColor: 'black' }; Testimony.propTypes = { authorAvatar: _propTypes2.default.string, authorName: _propTypes2.default.string, authorTitle: _propTypes2.default.string, bubbleBg: _propTypes2.default.string, bubbleColor: _propTypes2.default.string, children: _propTypes2.default.any }; exports.default = Testimony;