Skip to content

Commit

Permalink
narcis review feedback incorporated from PR adobecom#2928
Browse files Browse the repository at this point in the history
  • Loading branch information
Rohit Sahu committed Sep 27, 2024
1 parent 8da11ef commit 398f172
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
9 changes: 0 additions & 9 deletions libs/features/cdt/cdt.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
font-size: var(--type-body-s-size);
font-weight: 700;
line-height: var(--type-body-xxl-size);
}

.light .timer-label {
color: #000;
}

Expand Down Expand Up @@ -58,9 +55,6 @@
font-weight: 700;
text-align: center;
line-height: var(--type-body-xxl-size);
}

.light .timer-box {
background-color: #222;
color: #FFF;
}
Expand All @@ -86,9 +80,6 @@ html[dir="rtl"] .timer-unit-container {
font-weight: 400;
text-align: start;
line-height: var(--type-body-xxl-size);
}

.light .timer-unit-label {
color: #464646;
}

Expand Down
3 changes: 2 additions & 1 deletion libs/features/cdt/cdt.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,14 @@ export default async function initCDT(el, classList) {
const parsedTime = Date.parse(time?.trim());
return Number.isNaN(parsedTime) ? null : parsedTime;
});

if (timeRangesEpoch.includes(null)) {
throw new Error('Invalid format for countdown timer range');
}

const cdtDiv = createTag('div', { class: 'countdown-timer' }, null, { parent: el });
cdtDiv.classList.add(isMobile() ? 'vertical' : 'horizontal');
cdtDiv.classList.add(classList.contains('dark') ? 'dark' : 'light');
if (classList.contains('dark')) cdtDiv.classList.add('dark');
if (classList.contains('center')) cdtDiv.classList.add('center');

loadCountdownTimer(cdtDiv, cdtLabel, cdtDays, cdtHours, cdtMins, timeRangesEpoch);
Expand Down
2 changes: 1 addition & 1 deletion libs/utils/decorate.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,6 @@ export async function loadCDT(el, classList) {
.then(({ default: initCDT }) => initCDT(el, classList)),
]);
} catch (error) {
window.lana?.log(`Failed to load countdown timer module: ${error}`, { tags: 'countdown-timer' });
window.lana?.log(`WARN: Failed to load countdown timer: ${error}`, { tags: 'errorType=warn,module=countdown-timer' });
}
}

0 comments on commit 398f172

Please sign in to comment.