Skip to content

Commit

Permalink
updated overline
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeganderson committed Nov 1, 2024
1 parent a706a51 commit cbd8b64
Showing 1 changed file with 27 additions and 6 deletions.
33 changes: 27 additions & 6 deletions blocks/large-promo-block/features/large-promo/default.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,13 @@ export const LargePromoPresentation = ({
contentDate ? (
<Stack className={`${BLOCK_CLASS_NAME}__text`}>
{contentOverline ? (
<Overline href={contentOverlineURL} {...editableOverline} suppressContentEditableWarning>{contentOverline}</Overline>
<Overline
href={contentOverlineURL}
{...editableOverline}
suppressContentEditableWarning
>
{contentOverline}
</Overline>
) : null}
{contentHeading || contentDescription || contentAuthors || contentDate ? (
<Stack>
Expand Down Expand Up @@ -300,11 +306,7 @@ const LargePromoItem = ({ customFields, arcSite }) => {
: "";
const phrases = usePhrases();

const editableOverline =
content?.label?.basic?.text ? editableContent(content, "label.basic.text") : {};

const editableHeading =
content?.headlines ? editableContent(content, "headlines.basic") : {};
const editableHeading = content?.headlines ? editableContent(content, "headlines.basic") : {};

const editableDescription = content?.description
? editableContent(content, "description.basic")
Expand Down Expand Up @@ -336,6 +338,25 @@ const LargePromoItem = ({ customFields, arcSite }) => {
content?.websites?.[arcSite]?.website_section || {};

let [overlineText, overlineURL] = [sectionText, sectionUrl];
const shouldUseLabel = !!labelDisplay;

let editableOverline = content?.websites?.[arcSite]?.website_section?.name
? editableContent(content, `websites.${[arcSite]}.website_section.name`)
: {};

if (content?.owner?.sponsored) {
overlineText = content?.label?.basic?.text || phrases.t("global.sponsored-content");
overlineURL = null;
editableOverline = content?.label?.basic?.text
? editableContent(content, "label.basic.text")
: {};
} else if (shouldUseLabel) {
[overlineText, overlineURL] = [labelText, labelUrl];
editableOverline = content?.label?.basic?.text
? editableContent(content, "label.basic.text")
: {};
}

if (content?.owner?.sponsored) {
overlineText = content?.label?.basic?.text || phrases.t("global.sponsored-content");
overlineURL = null;
Expand Down

0 comments on commit cbd8b64

Please sign in to comment.