Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:redturtle/design-comuni-plone-th…
Browse files Browse the repository at this point in the history
…eme into develop
  • Loading branch information
giuliaghisini committed Sep 21, 2023
2 parents cd8fc79 + e67e57a commit a13c6a0
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react';
import cx from 'classnames';

const BodyWrapper = ({ data, inEditMode, children }) => {
const BodyWrapper = ({ data, inEditMode, children, id }) => {
return (
<div className={cx('container pt-5', { 'p-5': inEditMode })}>
<h2>{data.text}</h2>
<h2 id={id + 'title'}>{data.text}</h2>
<div className="grid mt-5">{children}</div>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const View = ({ data, id }) => {
<div className="block full-width">
<div className="argumentInEvidence">
<ArgumentsInEvidenceBackground />
<BodyWrapper data={data} inEditMode={false}>
<BodyWrapper data={data} inEditMode={false} id={id}>
{data.subblocks
?.filter((subblock) => {
return subblock.argument?.length > 0;
Expand Down
2 changes: 1 addition & 1 deletion src/components/ItaliaTheme/Blocks/CTABlock/Block.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const Block = ({
)}
<Container tag="div" className="px-3 px-md-4">
<div className="cta-tile-text">
<h2 className="title mt-0">
<h2 className="title mt-0" id={block + 'title'}>
{inEditMode ? (
<div
ref={titleRef}
Expand Down
4 changes: 2 additions & 2 deletions src/components/ItaliaTheme/Blocks/CTABlock/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import BodyWrapper from 'design-comuni-plone-theme/components/ItaliaTheme/Blocks

import Block from 'design-comuni-plone-theme/components/ItaliaTheme/Blocks/CTABlock/Block';

const View = ({ data }) => {
const View = ({ data, id }) => {
return (
<BodyWrapper inEditMode={false}>
<Block data={data} inEditMode={false} />
<Block data={data} inEditMode={false} block={id} />
</BodyWrapper>
);
};
Expand Down
1 change: 1 addition & 0 deletions src/components/ItaliaTheme/Blocks/Calendar/Body.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ const Body = ({ data, block, inEditMode, path, onChangeBlock, reactSlick }) => {
'mt-5': !data.show_block_bg,
'mb-4': !location_filters_buttons,
})}
id={block + 'title'}
>
{data.title}
</h2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,17 @@ const CardWithImageRssTemplate = ({
moment: Moment,
}) => {
const intl = useIntl();

const titleID = data?.title ? data.title.replace(/[^A-Z0-9]+/gi, '_') : '';
return (
<div className={cx('', { 'public-ui': isEditMode })} aria-live="polite">
{items?.length > 0 ? (
<>
{data.title && (
<Row>
<Col>
<h2 className="mb-4 mt-5">{data.title}</h2>
<h2 className="mb-4 mt-5" id={titleID}>
{data.title}
</h2>
</Col>
</Row>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ const CardWithoutImageRssTemplate = ({
items = [],
isEditMode,
data = {},
moment: Moment,
//moment: Moment,
}) => {
const intl = useIntl();
const titleID = data?.title ? data.title.replace(/[^A-Z0-9]+/gi, '_') : '';

return (
<div className={cx('', { 'public-ui': isEditMode })} aria-live="polite">
Expand All @@ -43,7 +44,9 @@ const CardWithoutImageRssTemplate = ({
{data.title && (
<Row>
<Col>
<h2 className="mb-4 mt-5">{data.title}</h2>
<h2 className="mb-4 mt-5" id={titleID}>
{data.title}
</h2>
</Col>
</Row>
)}
Expand Down

0 comments on commit a13c6a0

Please sign in to comment.