Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.

Commit c28f8e2

Browse files
committed
add placeholder for customer information
1 parent 4459bf5 commit c28f8e2

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed
Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,29 @@
1-
/* stylelint-disable no-empty-source */
1+
.commerce-customer-information.placeholder.block::before {
2+
content: "Customer Information";
3+
position: absolute;
4+
font-size: 20px;
5+
font-weight: bold;
6+
color: rgb(0 0 0 / 20%);
7+
z-index: -1;
8+
}
9+
10+
.commerce-customer-information.placeholder.block {
11+
display: flex;
12+
border: dashed 3px lightgrey;
13+
padding: 10px;
14+
}
15+
16+
.commerce-customer-information.placeholder.block > div {
17+
flex-grow: 1;
18+
padding: 10px;
19+
display:flex;
20+
justify-content: center;
21+
}
22+
23+
.commerce-customer-information.placeholder.block > div > div {
24+
padding: 10px;
25+
}
26+
27+
.commerce-customer-information.placeholder.block > div > div:first-child {
28+
font-weight: bold;
29+
}

blocks/commerce-customer-information/commerce-customer-information.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ import { CUSTOMER_LOGIN_PATH } from '../../scripts/constants.js';
99
import '../../scripts/initializers/account.js';
1010

1111
export default async function decorate(block) {
12+
// Xwalk: if in AEM author and not authenticated show placeholder instead
13+
if (window.xwalk.isAuthorEnv && !checkIsAuthenticated()) {
14+
block.classList.add('placeholder');
15+
return;
16+
}
17+
1218
if (!checkIsAuthenticated()) {
1319
window.location.href = CUSTOMER_LOGIN_PATH;
1420
} else {

0 commit comments

Comments
 (0)