forked from M3-Academy/challenge-vtex-io
Entrega do Desafio #1
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",
|
"condition-layout.product#availability",
|
||||||
// "flex-layout.row#description",
|
// "flex-layout.row#description",
|
||||||
"tab-layout#description",
|
"tab-layout#description",
|
||||||
"flex-layout.row#specifications-title",
|
// "flex-layout.row#specifications-title",
|
||||||
"product-specification-group#table",
|
// "product-specification-group#table",
|
||||||
"shelf.relatedProducts",
|
"shelf.relatedProducts",
|
||||||
"product-questions-and-answers"
|
"product-questions-and-answers"
|
||||||
]
|
]
|
||||||
@ -19,14 +19,14 @@
|
|||||||
},
|
},
|
||||||
"children": ["breadcrumb"]
|
"children": ["breadcrumb"]
|
||||||
},
|
},
|
||||||
"flex-layout.row#specifications-title": {
|
// "flex-layout.row#specifications-title": {
|
||||||
"children": ["rich-text#specifications"]
|
// "children": ["rich-text#specifications"]
|
||||||
},
|
// },
|
||||||
"rich-text#specifications": {
|
// "rich-text#specifications": {
|
||||||
"props": {
|
// "props": {
|
||||||
"text": "##### Product Specifications"
|
// "text": "##### Product Specifications"
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
|
|
||||||
"condition-layout.product#availability": {
|
"condition-layout.product#availability": {
|
||||||
"props": {
|
"props": {
|
||||||
@ -210,7 +210,8 @@
|
|||||||
"product-gifts",
|
"product-gifts",
|
||||||
// "flex-layout.row#buy-button",
|
// "flex-layout.row#buy-button",
|
||||||
"availability-subscriber",
|
"availability-subscriber",
|
||||||
"shipping-simulator"
|
"shipping-simulator",
|
||||||
|
"placeholder-component"
|
||||||
// "share#default"
|
// "share#default"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -306,4 +307,3 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,5 +11,8 @@
|
|||||||
},
|
},
|
||||||
"pix-component": {
|
"pix-component": {
|
||||||
"component": "Pix"
|
"component": "Pix"
|
||||||
|
},
|
||||||
|
"placeholder-component": {
|
||||||
|
"component": "Placeholder"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user