UNPKG

@momentum-ui/react-collaboration

Version:

Cisco Momentum UI Framework for React Collaboration Applications

64 lines 5.13 kB
var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; var __rest = (this && this.__rest) || function (s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; }; import React, { cloneElement } from 'react'; import classnames from 'classnames'; import Card, { CARD_CONSTANTS } from '../Card'; import { STYLE, DEFAULTS } from './MeetingContainer.constants'; import './MeetingContainer.style.scss'; import Text, { TEXT_CONSTANTS } from '../Text'; import DividerDot from '../DividerDot'; import ButtonGroup from '../ButtonGroup'; /** * The MeetingContainer component. * @deprecated Use the equivalent from momentum.design (NPM: `@momentum-design/components/dist/react`) */ var MeetingContainer = function (props) { var className = props.className, id = props.id, tags = props.tags, actionButtons = props.actionButtons, meetingTitle = props.meetingTitle, avatar = props.avatar, children = props.children, spaceLink = props.spaceLink, classification = props.classification, scheduleInfoFirst = props.scheduleInfoFirst, scheduleInfoSecond = props.scheduleInfoSecond, _a = props.scheduleInfoFirstColor, scheduleInfoFirstColor = _a === void 0 ? DEFAULTS.SCHEDULE_INFO_COLOR : _a, _b = props.scheduleInfoSecondColor, scheduleInfoSecondColor = _b === void 0 ? DEFAULTS.SCHEDULE_INFO_COLOR : _b, isDisabled = props.isDisabled, statusColor = props.statusColor, _c = props.titleType, titleType = _c === void 0 ? DEFAULTS.TITLE_TYPE : _c, _d = props.titleTagName, titleTagName = _d === void 0 ? DEFAULTS.TITLE_TAG_NAME : _d, otherProps = __rest(props, ["className", "id", "tags", "actionButtons", "meetingTitle", "avatar", "children", "spaceLink", "classification", "scheduleInfoFirst", "scheduleInfoSecond", "scheduleInfoFirstColor", "scheduleInfoSecondColor", "isDisabled", "statusColor", "titleType", "titleTagName"]); var title = meetingTitle || children; var changedAvatar = !!avatar && cloneElement(avatar, { size: 32 }); var showTags = (tags === null || tags === void 0 ? void 0 : tags.length) > 0; var changedActionButtons = !!actionButtons && isDisabled ? actionButtons.map(function (actionButton) { return cloneElement(actionButton, { disabled: true }); }) : actionButtons; var changedTags = !!tags && isDisabled ? tags.map(function (tags) { return cloneElement(tags, { disabled: true }); }) : tags; var changedSpaceLink = !!spaceLink && cloneElement(spaceLink, { disabled: isDisabled, className: STYLE.spaceLink }); var classificationTag = !!classification && cloneElement(classification, { disabled: isDisabled }); return (React.createElement(Card, __assign({ className: classnames(className, STYLE.wrapper), id: id, statusColor: statusColor, height: CARD_CONSTANTS.HEIGHTS.AUTO, isDisabled: isDisabled }, otherProps), React.createElement("div", { className: STYLE.container }, changedAvatar && (React.createElement("div", { "data-anchor": showTags ? DEFAULTS.ANCHOR : undefined, className: STYLE.avatar }, changedAvatar)), React.createElement("div", { className: STYLE.details }, React.createElement("div", null, React.createElement(Text, { tagName: titleTagName, type: titleType, "data-disabled": isDisabled }, title), changedSpaceLink && React.createElement(DividerDot, null), changedSpaceLink, React.createElement("div", { className: STYLE.classification }, classificationTag)), React.createElement("div", null, React.createElement(Text, { type: TEXT_CONSTANTS.TYPES.BODY_SECONDARY, tagName: "small", "data-color": isDisabled ? DEFAULTS.SCHEDULE_INFO_COLOR : scheduleInfoFirstColor }, scheduleInfoFirst), scheduleInfoSecond && React.createElement(DividerDot, null), React.createElement(Text, { type: TEXT_CONSTANTS.TYPES.BODY_SECONDARY, tagName: "small", "data-color": isDisabled ? DEFAULTS.SCHEDULE_INFO_COLOR : scheduleInfoSecondColor }, scheduleInfoSecond)), showTags && React.createElement("div", { className: STYLE.tags }, changedTags)), React.createElement("div", { "data-anchor": showTags ? DEFAULTS.ANCHOR : undefined, className: STYLE.actions }, React.createElement(ButtonGroup, { spaced: true }, changedActionButtons))))); }; export default MeetingContainer; //# sourceMappingURL=MeetingContainer.js.map