Skip to content

Commit

Permalink
update datasource
Browse files Browse the repository at this point in the history
  • Loading branch information
yesil committed Aug 30, 2024
1 parent 74076a2 commit f49daa6
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 74 deletions.
151 changes: 80 additions & 71 deletions libs/deps/mas/mas.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion libs/deps/mas/merch-datasource.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions libs/features/mas/web-components/src/merch-datasource.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,21 @@ async function parseMerchCard(fragmentData, appendFn, merchCard, consonant) {
const footer = createTag('div', { slot: 'footer' }, item.ctas);
const ctas = [];
[...footer.querySelectorAll('a')].forEach((cta) => {
const strong = cta.parentElement.tagName === 'STRONG';
if (consonant) {
cta.classList.add('con-button');
if (cta.parentElement.tagName === 'STRONG') {
if (strong) {
cta.classList.add('blue');
}
ctas.push(cta);
} else {
const spectrumCta = createTag('sp-button', {}, cta);
const treatment = strong ? 'fill' : 'outline';
const variant = strong ? 'accent' : 'primary';
const spectrumCta = createTag(
'sp-button',
{ treatment, variant },
cta,
);
spectrumCta.addEventListener('click', (e) => {
/* c8 ignore next 2 */
e.stopPropagation();
Expand Down

0 comments on commit f49daa6

Please sign in to comment.