UNPKG

@atlaskit/comment

Version:

A comment displays discussions and user feedback.

56 lines (55 loc) • 2.03 kB
/* layout.tsx generated by @compiled/babel-plugin v3.0.2 */ import "./layout.compiled.css"; import * as React from 'react'; import { ax, ix } from "@compiled/react/runtime"; import { cx } from '@atlaskit/css'; import { Box, Grid, Stack } from '@atlaskit/primitives/compiled'; import AvatarSlot from './slots/avatar-slot'; import ContentSlot from './slots/content-slot'; var containerStyles = { root: "_kqswh2mm _yv0e5bpd _1lmc1gx3" }; var inlineCommentStyles = { root: "_1lmc1rav" }; var noChildrenStyles = { root: "_1lmcvpz5" }; // if the background is appied on Box and tokens are not switched on it breaks. // This can be safely removed (and applied on Box) when tokens are on by default var highlightOverlayStyles = { root: "_1r04x0bf _nd5l1sux _1q51u2gc _y4tiu2gc _85i5u2gc _bozgu2gc _kqswstnw _lcxvglyw" }; var stackOverrideStyles = { root: "_nd5l1dav _1q511ejb" }; /** * __CommentLayout__ * * The base layout for the comment component. * */ var Layout = function Layout(_ref) { var content = _ref.content, children = _ref.children, highlighted = _ref.highlighted, id = _ref.id, shouldRenderNestedCommentsInline = _ref.shouldRenderNestedCommentsInline, testId = _ref.testId, avatar = _ref.avatar; return /*#__PURE__*/React.createElement(Grid, { gap: "space.100", xcss: cx(containerStyles.root, shouldRenderNestedCommentsInline && inlineCommentStyles.root, !children && noChildrenStyles.root), testId: testId, id: id }, avatar && /*#__PURE__*/React.createElement(AvatarSlot, null, avatar), content && /*#__PURE__*/React.createElement(ContentSlot, null, content), children && /*#__PURE__*/React.createElement(Stack, { xcss: stackOverrideStyles.root, space: "space.400" }, children), highlighted && /*#__PURE__*/React.createElement(Box, { xcss: highlightOverlayStyles.root, backgroundColor: "color.background.neutral", testId: testId && "".concat(testId, "-highlighted") })); }; Layout.displayName = 'CommentLayout'; export default Layout;