feat: adicionando componente Placeholder

This commit is contained in:
Ana Carolina Duarte Cavalcante 2023-01-27 09:32:52 -03:00
parent 0332eaa5e5
commit cc7985610f
4 changed files with 35 additions and 12 deletions

3
react/Placeholder.tsx Normal file
View File

@ -0,0 +1,3 @@
import Placeholder from "./components/Placeholder/Placeholder";
export default Placeholder;

View File

@ -0,0 +1,17 @@
const Placeholder = () => {
if (typeof document !== "undefined") {
const postalCodeInput = document.querySelector(
".vtex-address-form-4-x-input"
);
const postalCodeValue = document.querySelector(".postalCode");
if (postalCodeInput) {
postalCodeInput.classList.add("postalCode");
}
if (postalCodeValue) {
postalCodeValue.setAttribute("placeholder", "Digite seu CEP");
}
}
return null;
};
export default Placeholder;

View File

@ -5,8 +5,8 @@
"condition-layout.product#availability",
// "flex-layout.row#description",
"tab-layout#description",
"flex-layout.row#specifications-title",
"product-specification-group#table",
// "flex-layout.row#specifications-title",
// "product-specification-group#table",
"shelf.relatedProducts",
"product-questions-and-answers"
]
@ -19,14 +19,14 @@
},
"children": ["breadcrumb"]
},
"flex-layout.row#specifications-title": {
"children": ["rich-text#specifications"]
},
"rich-text#specifications": {
"props": {
"text": "##### Product Specifications"
}
},
// "flex-layout.row#specifications-title": {
// "children": ["rich-text#specifications"]
// },
// "rich-text#specifications": {
// "props": {
// "text": "##### Product Specifications"
// }
// },
"condition-layout.product#availability": {
"props": {
@ -210,7 +210,8 @@
"product-gifts",
// "flex-layout.row#buy-button",
"availability-subscriber",
"shipping-simulator"
"shipping-simulator",
"placeholder-component"
// "share#default"
]
},
@ -306,4 +307,3 @@
}
}
}

View File

@ -11,5 +11,8 @@
},
"pix-component": {
"component": "Pix"
},
"placeholder-component": {
"component": "Placeholder"
}
}