From 3b45cc890f769ab839f9abd30968ff9ca4ef82e7 Mon Sep 17 00:00:00 2001 From: Sara Bianchi <43245702+SaraBianchi@users.noreply.github.com> Date: Thu, 11 Jan 2024 12:36:50 +0100 Subject: [PATCH] fix: font and spaces of Card blocks (#476) * fix: fixed font and spaces of Card blocks * chore: updated release log --------- Co-authored-by: Piero Nicolli --- RELEASE.md | 1 + .../Blocks/TextCard/CardWithImage/Block.jsx | 76 ++++++++----------- .../Blocks/TextCard/SimpleCard/Block.jsx | 62 +++++++-------- 3 files changed, 61 insertions(+), 78 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 98a31b5e7..286eb42d9 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -51,6 +51,7 @@ ### Fix - Risolto un problema nel blocco Video Gallery, per cui alcuni video di youtube non erano riproducibili. +- Sistemate spaziature e font su mobile del blocco Card con Immagine e Card Semplice, migliorato il layout di quest'ultimo. - È stato migliorato il contrasto minimo necessario tra sfondo e testo nei blocchi numeri, countdown e galleria a griglia. ## Versione 11.1.4 (05/01/2024) diff --git a/src/components/ItaliaTheme/Blocks/TextCard/CardWithImage/Block.jsx b/src/components/ItaliaTheme/Blocks/TextCard/CardWithImage/Block.jsx index 9f5e5ea48..c1f084b73 100644 --- a/src/components/ItaliaTheme/Blocks/TextCard/CardWithImage/Block.jsx +++ b/src/components/ItaliaTheme/Blocks/TextCard/CardWithImage/Block.jsx @@ -1,14 +1,7 @@ /* eslint-disable jsx-a11y/no-static-element-interactions */ /* eslint-disable jsx-a11y/click-events-have-key-events */ -import React, { useState, useRef, useEffect } from 'react'; -import { - Card, - CardBody, - CardText, - Container, - Row, - Col, -} from 'design-react-kit'; +import React, { useState, useEffect } from 'react'; +import { Card, CardBody, Container, Row, Col } from 'design-react-kit'; import { defineMessages, useIntl } from 'react-intl'; import PropTypes from 'prop-types'; import redraft from 'redraft'; @@ -113,7 +106,7 @@ const Block = ({ )} - + {inEditMode ? ( {hasImage && ( - + {renderImage(data?.image, hasImage, data?.sizeNatural)} )}
- - onChange(data)} - placeholder={intl.formatMessage( - messages.image_card_content, - )} - showToolbar={true} - onSelectBlock={onSelectBlock} - onAddBlock={onAddBlock} - index={index} - onFocusNextBlock={onFocusNextBlock} - onFocusPreviousBlock={() => { - setSelectedField('title'); - }} - /> - + onChange(data)} + placeholder={intl.formatMessage( + messages.image_card_content, + )} + showToolbar={true} + onSelectBlock={onSelectBlock} + onAddBlock={onAddBlock} + index={index} + onFocusNextBlock={onFocusNextBlock} + onFocusPreviousBlock={() => { + setSelectedField('title'); + }} + />
@@ -180,28 +169,27 @@ const Block = ({ 'revert-row': data?.rightImage, })} > - + {renderImage(data?.image, hasImage, data?.sizeNatural)}
- - {redraft( - content, - config.settings.richtextViewSettings.ToHTMLRenderers, - config.settings.richtextViewSettings.ToHTMLOptions, - )} - + {redraft( + content, + config.settings.richtextViewSettings.ToHTMLRenderers, + config.settings.richtextViewSettings.ToHTMLOptions, + )}
diff --git a/src/components/ItaliaTheme/Blocks/TextCard/SimpleCard/Block.jsx b/src/components/ItaliaTheme/Blocks/TextCard/SimpleCard/Block.jsx index 06cbfa8dd..6d3365fb5 100644 --- a/src/components/ItaliaTheme/Blocks/TextCard/SimpleCard/Block.jsx +++ b/src/components/ItaliaTheme/Blocks/TextCard/SimpleCard/Block.jsx @@ -1,7 +1,7 @@ /* eslint-disable jsx-a11y/no-static-element-interactions */ /* eslint-disable jsx-a11y/click-events-have-key-events */ -import React, { useState, useRef, useEffect } from 'react'; -import { Card, CardBody, CardTitle, CardText } from 'design-react-kit'; +import React, { useState, useEffect } from 'react'; +import { Card, CardBody, CardTitle } from 'design-react-kit'; import { defineMessages, useIntl } from 'react-intl'; import PropTypes from 'prop-types'; import redraft from 'redraft'; @@ -98,28 +98,26 @@ const Block = ({ setSelectedField('content'); }} > - - - onChange(data, 'simple_card_content') - } - placeholder={intl.formatMessage( - messages.simple_card_content, - )} - showToolbar={true} - onSelectBlock={onSelectBlock} - onAddBlock={onAddBlock} - index={index} - onFocusNextBlock={onFocusNextBlock} - onFocusPreviousBlock={() => { - setSelectedField('title'); - }} - /> - + + onChange(data, 'simple_card_content') + } + placeholder={intl.formatMessage( + messages.simple_card_content, + )} + showToolbar={true} + onSelectBlock={onSelectBlock} + onAddBlock={onAddBlock} + index={index} + onFocusNextBlock={onFocusNextBlock} + onFocusPreviousBlock={() => { + setSelectedField('title'); + }} + /> ) : ( @@ -127,16 +125,12 @@ const Block = ({ {title} - -
- - {redraft( - content, - config.settings.richtextViewSettings.ToHTMLRenderers, - config.settings.richtextViewSettings.ToHTMLOptions, - )} - -
+
+ {redraft( + content, + config.settings.richtextViewSettings.ToHTMLRenderers, + config.settings.richtextViewSettings.ToHTMLOptions, + )} )}