cometchat-react-ui-kit2
Version:
CometChat UI Kit for React App
108 lines (107 loc) • 4.87 kB
JavaScript
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.messageListStyle = exports.messageHeaderStyle = exports.messageComposerStyle = exports.liveReactionWrapperStyle = exports.liveReactionStyle = exports.chatWrapperStyle = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _Shared = require("../../Shared");
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 chatWrapperStyle = function chatWrapperStyle(style) {
return {
display: "flex",
flexDirection: "column",
height: style.height,
width: style.width,
margin: "none",
boxSizing: "border-box",
position: "relative",
overflowX: "hidden"
};
};
exports.chatWrapperStyle = chatWrapperStyle;
var liveReactionWrapperStyle = function liveReactionWrapperStyle() {
return _objectSpread(_objectSpread({}, new _Shared.BaseStyles({
width: "100%",
height: "100%",
background: "none",
border: "none",
borderRadius: "none",
activeBackground: ""
})), {}, {
position: "absolute",
top: "0",
right: "0",
zIndex: "2",
display: "flex",
justifyContent: "left",
alignItems: "center",
boxSizing: "border-box"
});
};
exports.liveReactionWrapperStyle = liveReactionWrapperStyle;
var messageComposerStyle = function messageComposerStyle(props, theme) {
var _theme$palette, _theme$palette2;
return _objectSpread(_objectSpread({}, new _Shared.BaseStyles({
width: "100%",
height: "auto",
background: theme.palette.getBackground(),
border: "none",
borderRadius: "12px",
activeBackground: "none"
})), {}, {
inputBorderRadius: "8px",
inputBackground: theme.palette.getAccent50(),
inputTextFont: (0, _Shared.fontHelper)(theme.typography.subtitle1),
inputTextColor: theme === null || theme === void 0 ? void 0 : (_theme$palette = theme.palette) === null || _theme$palette === void 0 ? void 0 : _theme$palette.getAccent(),
placeholderTextFont: (0, _Shared.fontHelper)(theme.typography.subtitle1),
placeholderTextColor: theme.palette.getAccent600(),
emojiIconTint: theme.palette.getAccent500(),
attachmentIconTint: theme.palette.getAccent500(),
microphoneIconTint: theme.palette.getAccent500(),
sendButtonIconTint: theme.palette.getAccent50(),
stickerIconTint: theme.palette.getAccent500(),
stickerCloseIconTint: theme === null || theme === void 0 ? void 0 : (_theme$palette2 = theme.palette) === null || _theme$palette2 === void 0 ? void 0 : _theme$palette2.getPrimary()
});
};
exports.messageComposerStyle = messageComposerStyle;
var messageHeaderStyle = function messageHeaderStyle(theme) {
return _objectSpread(_objectSpread({}, new _Shared.BaseStyles({
width: "100%",
height: "auto",
background: theme.palette.getBackground(),
border: "none",
borderRadius: "none",
activeBackground: "none"
})), {}, {
backButtonIconTint: theme.palette.getPrimary()
});
};
exports.messageHeaderStyle = messageHeaderStyle;
var messageListStyle = function messageListStyle(props, theme) {
var _theme$palette3;
return _objectSpread(_objectSpread({}, new _Shared.BaseStyles({
width: "100%",
height: "100%",
background: theme.palette.getBackground(),
border: "none",
borderRadius: "8px",
activeBackground: "none"
})), {}, {
textFont: (0, _Shared.fontHelper)(theme.typography.subtitle2),
textColor: theme === null || theme === void 0 ? void 0 : (_theme$palette3 = theme.palette) === null || _theme$palette3 === void 0 ? void 0 : _theme$palette3.getAccent()
});
};
exports.messageListStyle = messageListStyle;
var liveReactionStyle = function liveReactionStyle() {
return _objectSpread({}, new _Shared.BaseStyles({
width: "20px",
height: "20px",
background: "transparent",
border: "none",
borderRadius: "none",
activeBackground: "transparent"
}));
};
exports.liveReactionStyle = liveReactionStyle;