Skip to content

Commit

Permalink
fix: callout line after title
Browse files Browse the repository at this point in the history
  • Loading branch information
giuliaghisini committed Feb 2, 2024
1 parent 3492d99 commit de55654
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 25 deletions.
42 changes: 19 additions & 23 deletions src/components/ItaliaTheme/Blocks/Callout/Edit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,8 @@ const messages = defineMessages({
* @extends Component
*/
const Edit = (props) => {
const {
data,
onChangeBlock,
block,
onSelectBlock,
selected,
...otherProps
} = props;
const { data, onChangeBlock, block, onSelectBlock, selected, ...otherProps } =
props;
const intl = useIntl();
const { selectedField, setSelectedField } = useHandleDetachedBlockFocus(
props,
Expand All @@ -55,21 +49,23 @@ const Edit = (props) => {
<CalloutTitle tag="h4">
{data.icon && <Icon icon={data.icon} padding={false} aria-hidden />}

<TextEditorWidget
{...otherProps}
showToolbar={false}
data={data}
block={block}
fieldName="title"
onChangeBlock={onChangeBlock}
selected={selectedField === 'title'}
placeholder={intl.formatMessage(messages.title)}
setSelected={setSelectedField}
focusNextField={() => {
setSelectedField('text');
}}
onSelectBlock={onSelectBlock}
/>
<div className="text">
<TextEditorWidget
{...otherProps}
showToolbar={false}
data={data}
block={block}
fieldName="title"
onChangeBlock={onChangeBlock}
selected={selectedField === 'title'}
placeholder={intl.formatMessage(messages.title)}
setSelected={setSelectedField}
focusNextField={() => {
setSelectedField('text');
}}
onSelectBlock={onSelectBlock}
/>
</div>
</CalloutTitle>
<CalloutText>
<TextEditorWidget
Expand Down
2 changes: 1 addition & 1 deletion src/components/ItaliaTheme/Blocks/Callout/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const View = ({ data, id }) => {
>
<CalloutTitle>
{data.icon && <Icon icon={data.icon} padding={false} aria-hidden />}
{data.title}
<span className="text">{data.title}</span>
</CalloutTitle>
<CalloutText>
<TextBlockView id={id} data={{ value: data.text }} />
Expand Down
7 changes: 6 additions & 1 deletion src/theme/ItaliaTheme/Blocks/_callout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@ body.cms-ui {
.callout {
.callout-title {
display: flex;

.icon {
flex: 1 0 100%;
max-width: 32px;
flex: 1 0 100%;
}

.text:after {
z-index: -1;
}
}

Expand Down

0 comments on commit de55654

Please sign in to comment.