Skip to content

Commit

Permalink
Integrate placeholders approach for static text
Browse files Browse the repository at this point in the history
  • Loading branch information
Ferri0 committed Nov 4, 2024
1 parent ca4bdfe commit 52b6071
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions blocks/commerce-order-header/commerce-order-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { events } from '@dropins/tools/event-bus.js';
import { Header, provider as uiProvider } from '@dropins/tools/components.js';
import { CUSTOMER_ORDER_DETAILS_PATH, CUSTOMER_ORDERS_PATH } from '../../scripts/constants.js';
import { fetchPlaceholders } from '../../scripts/aem.js';

export default async function decorate(block) {
block.innerHTML = '';
Expand All @@ -11,10 +12,11 @@ export default async function decorate(block) {
await uiProvider.render(Header, { title: 'Order' })(headerContainer);

if (window.location.href.includes(CUSTOMER_ORDER_DETAILS_PATH)) {
const placeholders = await fetchPlaceholders();

const link = document.createElement('a');

// TODO: Add i18n when appropriate functionality will be introduced in boilerplate
link.innerText = '< Back to all orders';
link.innerText = placeholders.orderOrderDetailsBack;
link.href = CUSTOMER_ORDERS_PATH;
link.classList.add('orders-list-link');

Expand Down
6 changes: 4 additions & 2 deletions blocks/commerce-return-header/commerce-return-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { events } from '@dropins/tools/event-bus.js';
import { Header, provider as uiProvider } from '@dropins/tools/components.js';
import { CUSTOMER_RETURN_DETAILS_PATH, CUSTOMER_RETURNS_PATH } from '../../scripts/constants.js';
import { fetchPlaceholders } from '../../scripts/aem.js';

// TODO - Will be refactored after https://jira.corp.adobe.com/browse/USF-1393 | https://atwix.atlassian.net/browse/EDS-426
// Initialize
Expand All @@ -15,10 +16,11 @@ export default async function decorate(block) {
await uiProvider.render(Header, { title: 'Return' })(headerContainer);

if (window.location.href.includes(CUSTOMER_RETURN_DETAILS_PATH)) {
const placeholders = await fetchPlaceholders();

const link = document.createElement('a');

// TODO: Add i18n when appropriate functionality will be introduced in boilerplate
link.innerText = '< Back to all returns';
link.innerText = placeholders.orderReturnDetailsBack;
link.href = CUSTOMER_RETURNS_PATH;
link.classList.add('returns-list-header');

Expand Down

0 comments on commit 52b6071

Please sign in to comment.