cometchat-react-ui-kit2
Version:
CometChat UI Kit for React App
61 lines (57 loc) • 2.25 kB
JavaScript
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.CometChatStatusIndicator = void 0;
var _react = _interopRequireDefault(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _Shared = require("../../../Shared");
var CometChatStatusIndicator = function CometChatStatusIndicator(props) {
/**
* Component style
*/
var getStyle = function getStyle() {
var _props$style, _props$style2, _props$style3, _props$style4, _props$style5;
return {
border: props === null || props === void 0 ? void 0 : (_props$style = props.style) === null || _props$style === void 0 ? void 0 : _props$style.border,
borderRadius: props === null || props === void 0 ? void 0 : (_props$style2 = props.style) === null || _props$style2 === void 0 ? void 0 : _props$style2.borderRadius,
backgroundColor: props === null || props === void 0 ? void 0 : (_props$style3 = props.style) === null || _props$style3 === void 0 ? void 0 : _props$style3.backgroundColor,
backgroundImage: "url(".concat(props.backgroundImage, ")"),
backgroundSize: "cover",
width: props === null || props === void 0 ? void 0 : (_props$style4 = props.style) === null || _props$style4 === void 0 ? void 0 : _props$style4.width,
height: props === null || props === void 0 ? void 0 : (_props$style5 = props.style) === null || _props$style5 === void 0 ? void 0 : _props$style5.height,
display: "inline-block",
position: "absolute",
top: "70%",
left: "70%"
};
};
/**
* Component template
*/
return /*#__PURE__*/_react["default"].createElement("span", {
style: getStyle()
});
};
/**
* Component default props values
*/
exports.CometChatStatusIndicator = CometChatStatusIndicator;
CometChatStatusIndicator.defaultProps = {
backgroundImage: "",
style: {
backgroundColor: "grey",
width: "14px",
height: "14px",
border: "2px solid #ffffff",
borderRadius: "50%"
}
};
/**
* Component default props
*/
CometChatStatusIndicator.propTypes = {
backgroundImage: _propTypes["default"].string,
style: _propTypes["default"].object
};