diff --git a/react/PlaceholderCep.ts b/react/PlaceholderCep.ts new file mode 100644 index 0000000..82bc38d --- /dev/null +++ b/react/PlaceholderCep.ts @@ -0,0 +1,3 @@ +import PlaceholderCep from "./components/PlaceholderCep/PlaceholderCep"; + +export default PlaceholderCep; diff --git a/react/components/PlaceholderCep/PlaceholderCep.tsx b/react/components/PlaceholderCep/PlaceholderCep.tsx new file mode 100644 index 0000000..ec52714 --- /dev/null +++ b/react/components/PlaceholderCep/PlaceholderCep.tsx @@ -0,0 +1,15 @@ + +const PlaceholderCep = () => { + + if (typeof document !== "undefined") { + + // document.getElementsByClassName("vtex-address-form-4-x-hideDecorators")[0].setAttribute("placeholder", "Digite seu CEP"); + + // .placeholder = "Digite seu CEP" + + }; + + return "" ; +}; + +export default PlaceholderCep; diff --git a/react/components/PlaceholderCep/styles.css b/react/components/PlaceholderCep/styles.css new file mode 100644 index 0000000..e69de29 diff --git a/react/tsconfig.json b/react/tsconfig.json index a26a540..9f1f13c 100644 --- a/react/tsconfig.json +++ b/react/tsconfig.json @@ -7,5 +7,5 @@ "moduleResolution": "node", "target": "es2017" }, - "include": ["./typings/*.d.ts", "./**/*.tsx", "./**/*.ts"] + "include": ["./typings/*.d.ts", "./**/*.tsx", "./**/*.ts", "components/PlaceholderCep/PlaceholderCep.tsx"] } \ No newline at end of file diff --git a/store/blocks/pdp/product.jsonc b/store/blocks/pdp/product.jsonc index 2cf6ab8..ac8a248 100644 --- a/store/blocks/pdp/product.jsonc +++ b/store/blocks/pdp/product.jsonc @@ -22,7 +22,8 @@ // "product-questions-and-answers", "rich-text#titleSlick", - "list-context.product-list#demo" + "list-context.product-list#demo", + "PlaceholderCep" ] }, "html#breadcrumb": { diff --git a/store/interfaces.json b/store/interfaces.json index 944c7be..267dcec 100644 --- a/store/interfaces.json +++ b/store/interfaces.json @@ -8,5 +8,8 @@ }, "pixCustom": { "component": "pixCustom" + }, + "PlaceholderCep": { + "component": "PlaceholderCep" } }