Skip to content

Commit

Permalink
Remove linkLabelProps
Browse files Browse the repository at this point in the history
  • Loading branch information
jwade1327 committed Apr 4, 2023
1 parent 3867888 commit b7e194c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@ import buildLinkUrl from '@science-medicine-group/package-common/utils/build-lin
$ const { req } = out.global;
$ const nativeAdLayout = get(req, "query.native-ad-layout");
$ const newsletter = getAsObject(input, "newsletter");
$ const { sectionName, date, content, linkLabelProps } = input;
$ const { adLocation, platformDesignator } = linkLabelProps;
$ const { sectionName, date, content } = input;

$ const url = buildLinkUrl(get(content, "siteContext.path"));
$ const company = getAsObject(content, "company");
$ const label = input.label || "Paid Advertisement";

$ const linkLabel = `ad|${adLocation}|${platformDesignator}|${company.name}|${content.name}`;

$ const imgStyles = {
"font-size": "14px",
"line-height": 0,
Expand Down Expand Up @@ -55,7 +52,7 @@ $ const imgLinkStyles = {
<table role="presentation" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top" style="font-size: 24px;line-height: 28px;color: #202022;font-weight: 700;text-decoration: none;padding:0 24px 0 0;">
<a href=url target="_blank" style="font-size: 24px;line-height: 28px;color: #202022;font-weight: 700;text-decoration: none;" linklabel=linkLabel>${content.name}</a>
<a href=url target="_blank" style="font-size: 24px;line-height: 28px;color: #202022;font-weight: 700;text-decoration: none;">${content.name}</a>
</td>
</tr>
<common-table-spacer-element height="12" />
Expand All @@ -67,7 +64,7 @@ $ const imgLinkStyles = {
<table>
<tr>
<td style="padding-right:24px">
<a href=url target="_blank" style="line-height: 90px;color: #257478;text-decoration: none;" linklabel=linkLabel>
<a href=url target="_blank" style="line-height: 90px;color: #257478;text-decoration: none;">
Presented by
</a>
</td>
Expand Down Expand Up @@ -157,7 +154,7 @@ $ const imgLinkStyles = {
<common-table-spacer-element height="9" />
<tr>
<td align="left" valign="top" style="font-size: 17px;line-height: 22px;color: #3475b6;font-weight: 400;">
<a href=url target="_blank" style="color: #68686a;text-decoration: none;" linklabel=linkLabel>
<a href=url target="_blank" style="color: #68686a;text-decoration: none;">
<table>
<tr>
<td style="-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px; border: solid 2px #68686a;padding: 6px 12px;">
Expand Down Expand Up @@ -229,7 +226,7 @@ $ const imgLinkStyles = {
<common-table-spacer-element height="9" />
<tr>
<td align="left" valign="top" style="font-size: 17px;line-height: 22px;color: #3475b6;font-weight: 400;">
<a href=url target="_blank" style="text-decoration: none;color: #3475b6;padding:0 24px 0 0;" linklabel=linkLabel>${content.name}</a>
<a href=url target="_blank" style="text-decoration: none;color: #3475b6;padding:0 24px 0 0;">${content.name}</a>
</td>
</tr>
</table>
Expand Down Expand Up @@ -289,7 +286,7 @@ $ const imgLinkStyles = {
<common-table-spacer-element height="12" />
<tr>
<td align="left" valign="top" style="font-size: 24px;line-height: 28px;color: #202022;font-weight: 700;text-decoration: none;padding:0 24px 0 0;">
<a href=url target="_blank" style="font-size: 24px;line-height: 28px;color: #202022;font-weight: 700;text-decoration: none;" linklabel=linkLabel>${content.name}</a>
<a href=url target="_blank" style="font-size: 24px;line-height: 28px;color: #202022;font-weight: 700;text-decoration: none;">${content.name}</a>
</td>
</tr>
<common-table-spacer-element height="12" />
Expand Down
6 changes: 2 additions & 4 deletions packages/common/components/blocks/ad/promotion-native.marko
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { get, getAsObject } from "@parameter1/base-cms-object-path";

$ const newsletter = getAsObject(input, "newsletter");
$ const { sectionName, date, content, linkLabelProps } = input;
$ const { adLocation, platformDesignator } = linkLabelProps;
$ const linkLabel = `ad|${adLocation}|${platformDesignator}|${content.company.name}|${content.name}`;
$ const { sectionName, date, content } = input;

$ content.labels = ["Sponsored"];

<common-content-list-item-block content=content withImage=false link-label=linkLabel />
<common-content-list-item-block content=content withImage=false />
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { get, getAsObject } from "@parameter1/base-cms-object-path";
import buildLinkUrl from '@science-medicine-group/package-common/utils/build-link-url';

$ const newsletter = getAsObject(input, "newsletter");
$ const { sectionName, date, content, linkLabelProps } = input;
$ const { sectionName, date, content } = input;

$ const url = buildLinkUrl(get(content, "siteContext.url"));
$ const company = getAsObject(content, "company");
Expand Down
3 changes: 0 additions & 3 deletions packages/common/components/blocks/ad/wrapper.marko
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ $ const PromotionComponent = promotionComponents[defaultValue(input.promotionCom
newsletter=newsletter
section-name=sectionName
content=convertAdToContent(data, { sectionName })
link-label-props=input.linkLabelProps
/>
</if>
<else-if(adUnit)>
Expand All @@ -38,7 +37,6 @@ $ const PromotionComponent = promotionComponents[defaultValue(input.promotionCom
ad-unit=adUnit
date=date
dpm=input.dpm
link-label-props=input.linkLabelProps
/>
</else-if>
</native-x-fetch>
Expand All @@ -49,6 +47,5 @@ $ const PromotionComponent = promotionComponents[defaultValue(input.promotionCom
ad-unit=adUnit
date=date
dpm=input.dpm
link-label-props=input.linkLabelProps
/>
</else-if>

0 comments on commit b7e194c

Please sign in to comment.