forked from M3-Academy/challenge-vtex-io
feat: adicionando componente Placeholder
This commit is contained in:
parent
0332eaa5e5
commit
cc7985610f
3
react/Placeholder.tsx
Normal file
3
react/Placeholder.tsx
Normal file
@ -0,0 +1,3 @@
|
||||
import Placeholder from "./components/Placeholder/Placeholder";
|
||||
|
||||
export default Placeholder;
|
17
react/components/Placeholder/Placeholder.tsx
Normal file
17
react/components/Placeholder/Placeholder.tsx
Normal 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;
|
@ -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 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -11,5 +11,8 @@
|
||||
},
|
||||
"pix-component": {
|
||||
"component": "Pix"
|
||||
},
|
||||
"placeholder-component": {
|
||||
"component": "Placeholder"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user