Skip to content

Commit

Permalink
fix: completeblocklinks show icon only if link and external, do not d…
Browse files Browse the repository at this point in the history
…uplicate a tag for accessibility
  • Loading branch information
deodorhunter committed Aug 8, 2023
1 parent d1f8258 commit 13bd32e
Showing 1 changed file with 18 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ import {
ListingLinkMore,
ListingImage,
} from 'design-comuni-plone-theme/components/ItaliaTheme';
import { Icon } from 'design-comuni-plone-theme/components/ItaliaTheme';
import { isInternalURL } from '@plone/volto/helpers/Url/Url';

import config from '@plone/volto/registry';

const CompleteBlockLinksTemplate = ({
items,
Expand Down Expand Up @@ -61,16 +65,20 @@ const CompleteBlockLinksTemplate = ({
<div>
<CardBody>
<CardTitle tag="h3" className="text-secondary">
{item['@type'] === 'Link' ? (
<UniversalLink
item={!isEditMode ? item : null}
href={isEditMode ? '#' : null}
>
{item.title}
</UniversalLink>
) : (
item.title
)}
{item.title}
{item['@type'] === 'Link' &&
!isInternalURL(
item.remoteUrl || item.getRemoteUrl,
) &&
config.settings.siteProperties
.markSpecialLinks && (
<Icon
icon="it-external-link"
title={title}
size="xs"
className="align-top ml-1 external-link"
/>
)}
</CardTitle>
{show_description && (
<CardText tag="p" className="text-secondary">
Expand Down

0 comments on commit 13bd32e

Please sign in to comment.