cometchat-react-ui-kit2
Version:
CometChat UI Kit for React App
56 lines (55 loc) • 6.41 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getListStyle = exports.getListBaseStyle = exports.containerStyle = void 0;
var _ = require("../../..");
var containerStyle = function containerStyle(style) {
return {
width: style === null || style === void 0 ? void 0 : style.width,
height: style === null || style === void 0 ? void 0 : style.height,
display: "flex",
flexDirection: "row",
alignItems: "center",
justifyContent: "center",
position: "relative",
border: style.border
};
};
exports.containerStyle = containerStyle;
var getListBaseStyle = function getListBaseStyle(style, theme) {
var _theme$palette, _theme$palette2, _theme$typography, _theme$palette3, _theme$palette4, _theme$palette5, _theme$typography2, _theme$palette6, _theme$palette7;
return {
width: "100%",
height: "100%",
border: "0px none",
borderRadius: style === null || style === void 0 ? void 0 : style.borderRadius,
background: (style === null || style === void 0 ? void 0 : style.background) || (theme === null || theme === void 0 ? void 0 : (_theme$palette = theme.palette) === null || _theme$palette === void 0 ? void 0 : _theme$palette.getBackground()),
titleColor: (style === null || style === void 0 ? void 0 : style.titleColor) || (theme === null || theme === void 0 ? void 0 : (_theme$palette2 = theme.palette) === null || _theme$palette2 === void 0 ? void 0 : _theme$palette2.getAccent()),
titleFont: (style === null || style === void 0 ? void 0 : style.titleFont) || (0, _.fontHelper)(theme === null || theme === void 0 ? void 0 : (_theme$typography = theme.typography) === null || _theme$typography === void 0 ? void 0 : _theme$typography.heading),
backIconTint: (style === null || style === void 0 ? void 0 : style.backIconTint) || (theme === null || theme === void 0 ? void 0 : (_theme$palette3 = theme.palette) === null || _theme$palette3 === void 0 ? void 0 : _theme$palette3.getPrimary()),
searchBorder: "1px solid ".concat(theme === null || theme === void 0 ? void 0 : (_theme$palette4 = theme.palette) === null || _theme$palette4 === void 0 ? void 0 : _theme$palette4.getAccent50()),
searchborderRadius: "8px",
searchBackground: (style === null || style === void 0 ? void 0 : style.searchBackground) || (theme === null || theme === void 0 ? void 0 : (_theme$palette5 = theme.palette) === null || _theme$palette5 === void 0 ? void 0 : _theme$palette5.getAccent50()),
searchTextFont: (style === null || style === void 0 ? void 0 : style.searchTextFont) || (0, _.fontHelper)(theme === null || theme === void 0 ? void 0 : (_theme$typography2 = theme.typography) === null || _theme$typography2 === void 0 ? void 0 : _theme$typography2.subtitle1),
searchTextColor: (style === null || style === void 0 ? void 0 : style.searchTextColor) || (theme === null || theme === void 0 ? void 0 : (_theme$palette6 = theme.palette) === null || _theme$palette6 === void 0 ? void 0 : _theme$palette6.getAccent500()),
searchIconTint: (style === null || style === void 0 ? void 0 : style.searchIconTint) || (theme === null || theme === void 0 ? void 0 : (_theme$palette7 = theme.palette) === null || _theme$palette7 === void 0 ? void 0 : _theme$palette7.getAccent500())
};
};
exports.getListBaseStyle = getListBaseStyle;
var getListStyle = function getListStyle(_userListConfiguration, theme) {
var _userListConfiguratio, _userListConfiguratio2, _userListConfiguratio3, _userListConfiguratio4, _theme$palette8, _userListConfiguratio5, _userListConfiguratio6, _userListConfiguratio7, _theme$typography3, _userListConfiguratio8, _theme$palette9, _userListConfiguratio9, _theme$typography4, _userListConfiguratio10, _theme$palette10;
return {
width: ((_userListConfiguratio = _userListConfiguration.style) === null || _userListConfiguratio === void 0 ? void 0 : _userListConfiguratio.width) || "100%",
height: ((_userListConfiguratio2 = _userListConfiguration.style) === null || _userListConfiguratio2 === void 0 ? void 0 : _userListConfiguratio2.height) || "100%",
border: ((_userListConfiguratio3 = _userListConfiguration.style) === null || _userListConfiguratio3 === void 0 ? void 0 : _userListConfiguratio3.border) || "0 none",
loadingIconTint: ((_userListConfiguratio4 = _userListConfiguration.style) === null || _userListConfiguratio4 === void 0 ? void 0 : _userListConfiguratio4.loadingIconTint) || (theme === null || theme === void 0 ? void 0 : (_theme$palette8 = theme.palette) === null || _theme$palette8 === void 0 ? void 0 : _theme$palette8.getAccent600()),
borderRadius: ((_userListConfiguratio5 = _userListConfiguration.style) === null || _userListConfiguratio5 === void 0 ? void 0 : _userListConfiguratio5.borderRadius) || "0px",
background: ((_userListConfiguratio6 = _userListConfiguration.style) === null || _userListConfiguratio6 === void 0 ? void 0 : _userListConfiguratio6.background) || "transparent",
emptyTextFont: ((_userListConfiguratio7 = _userListConfiguration.style) === null || _userListConfiguratio7 === void 0 ? void 0 : _userListConfiguratio7.emptyTextFont) || (0, _.fontHelper)(theme === null || theme === void 0 ? void 0 : (_theme$typography3 = theme.typography) === null || _theme$typography3 === void 0 ? void 0 : _theme$typography3.heading),
emptyTextColor: ((_userListConfiguratio8 = _userListConfiguration.style) === null || _userListConfiguratio8 === void 0 ? void 0 : _userListConfiguratio8.emptyTextColor) || (theme === null || theme === void 0 ? void 0 : (_theme$palette9 = theme.palette) === null || _theme$palette9 === void 0 ? void 0 : _theme$palette9.getAccent400()),
errorTextFont: ((_userListConfiguratio9 = _userListConfiguration.style) === null || _userListConfiguratio9 === void 0 ? void 0 : _userListConfiguratio9.errorTextColor) || (0, _.fontHelper)(theme === null || theme === void 0 ? void 0 : (_theme$typography4 = theme.typography) === null || _theme$typography4 === void 0 ? void 0 : _theme$typography4.heading),
errorTextColor: ((_userListConfiguratio10 = _userListConfiguration.style) === null || _userListConfiguratio10 === void 0 ? void 0 : _userListConfiguratio10.errorTextFont) || (theme === null || theme === void 0 ? void 0 : (_theme$palette10 = theme.palette) === null || _theme$palette10 === void 0 ? void 0 : _theme$palette10.getAccent400())
};
};
exports.getListStyle = getListStyle;