Skip to content

Commit

Permalink
change(items): use styles from volto styles panel
Browse files Browse the repository at this point in the history
  • Loading branch information
ichim-david committed Sep 22, 2022
1 parent ab83a5f commit 2b3b4a4
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions src/blocks/Listing/ItemTemplates.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import cx from 'classnames';
import { ConditionalLink, FormattedDate } from '@plone/volto/components';

import { getVoltoStyles } from '@eeacms/volto-listing-block/schema-utils';

import PreviewImage from '@eeacms/volto-listing-block/PreviewImage';

const BodyText = ({ item, hasDate, hasDescription }) => {
Expand All @@ -26,27 +28,13 @@ const BodyText = ({ item, hasDate, hasDescription }) => {
);
};

const getStyles = (props) => {
const { itemModel = {} } = props;
const res = {};
if (itemModel.maxDescription) {
res[`max-${itemModel.maxDescription}-lines`] = true;
}
return res;
};

const BasicItem = (props) => {
const { item, styles, className, itemModel = {}, isEditMode = false } = props;
const { hasImage, imageOnRightSide, hasDate, hasDescription } = itemModel;

return (
<div
className={cx(
'u-item listing-item',
styles?.theme,
getStyles(props),
className,
)}
className={cx('u-item listing-item', getVoltoStyles(styles), className)}
>
<div className="wrapper">
<div className="slot-top">
Expand Down

0 comments on commit 2b3b4a4

Please sign in to comment.