Skip to content

Commit

Permalink
chore: rollback widget change that is not needed anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
pnicolli committed Nov 14, 2023
1 parent 34fbe49 commit 4dbf463
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 24 deletions.
2 changes: 1 addition & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

### Fix

- Le icone del Blocco Numer, del Blocco Icone e della Sidebar si aggiornano istantaneamente quando vengono cambiate
- Le icone del Blocco Numeri, del Blocco Icone e della Sidebar si aggiornano istantaneamente quando vengono cambiate
- Sistemato un bug nell'header dei sottositi che mostrava le voci del menu del sito padre anche se queste erano indicate come non visibili nella configurazione del menu.

## Versione 10.3.0 (08/11/2023)
Expand Down
39 changes: 16 additions & 23 deletions src/components/ItaliaTheme/manage/Widgets/IconPreviewWidget.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React, { useState, useEffect } from 'react';
import PropTypes from 'prop-types';
import { FontAwesomeIcon } from 'design-comuni-plone-theme/components/ItaliaTheme';
import { defineMessages, useIntl } from 'react-intl';
Expand All @@ -14,11 +13,6 @@ const messages = defineMessages({
const IconPreviewWidget = ({ icon, onEdit, title, description, children }) => {
const intl = useIntl();
const parts = icon?.split(' ') ?? [];
const [iconValue, setIconValue] = useState('');

useEffect(() => {
setIconValue(icon);
}, [icon]);

return (
<Form.Field inline className="help" id="icon-preview-widget-id">
Expand All @@ -32,23 +26,22 @@ const IconPreviewWidget = ({ icon, onEdit, title, description, children }) => {
<Grid.Column width={8}>
<div className="ui input flex-center">
<p className="help">
{icon === iconValue &&
(icon ? (
<>
{parts.length > 1 ? (
<FontAwesomeIcon
icon={[parts[0], parts[1]]}
className="show-icon"
/>
) : (
<FontAwesomeIcon icon={icon} className="show-icon" />
)}
</>
) : (
<span>
{intl.formatMessage(messages.previewIconSelected)}
</span>
))}
{icon ? (
<>
{parts.length > 1 ? (
<FontAwesomeIcon
icon={[parts[0], parts[1]]}
className="show-icon"
/>
) : (
<FontAwesomeIcon icon={icon} className="show-icon" />
)}
</>
) : (
<span>
{intl.formatMessage(messages.previewIconSelected)}
</span>
)}
</p>
</div>
</Grid.Column>
Expand Down

0 comments on commit 4dbf463

Please sign in to comment.