UNPKG

cometchat-react-ui-kit2

Version:

CometChat UI Kit for React App

73 lines (72 loc) 2.94 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.listTitle = exports.listItemIconStyle = exports.listItem = exports.iconBackgroundStyle = void 0; var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } var listItem = function listItem(props) { return _objectSpread({}, props.style); }; exports.listItem = listItem; var listTitle = function listTitle(props) { var margin = { margin: "0 6px" }, padding = { padding: "5px 5px" }; if (props.style.margin || props.style.padding) { margin = { margin: props.style.margin }; padding = { padding: props.style.padding }; } return _objectSpread(_objectSpread(_objectSpread({}, margin), {}, { background: "transparent", textTransform: "capitalize" }, padding), {}, { font: props.style.textFont, color: props.style.textColor, wordWrap: "break-word", cursor: "pointer" }); }; exports.listTitle = listTitle; var listItemIconStyle = function listItemIconStyle(props) { var padding = { padding: "5px 5px" }; if (props.style.margin || props.style.padding) { padding = { padding: props.style.padding }; } return _objectSpread(_objectSpread({ WebkitMask: "url(".concat(props.iconURL, ")center center no-repeat"), background: props.style.iconTint, transform: props.style.iconTransform, width: props.style.iconWidth, height: props.style.iconHeight }, padding), {}, { cursor: "pointer" }); }; exports.listItemIconStyle = listItemIconStyle; var iconBackgroundStyle = function iconBackgroundStyle(props) { return { borderRadius: "50%", background: props.style.iconBackground, cursor: "pointer", display: "flex", justifyContent: "center", alignItems: "center", width: props.style.iconBackgroundWidth, height: props.style.iconBackgroundHeight }; }; exports.iconBackgroundStyle = iconBackgroundStyle;