Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Twitter meta tags to product page #530

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
40 changes: 23 additions & 17 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"vtex.product-review-interfaces": "1.x",
"vtex.rich-text": "0.x",
"vtex.native-types": "0.x",
"vtex.telemarketing": "2.x"
"vtex.telemarketing": "2.x",
"vtex.twitter-meta-tags": "0.x"
},
"settingsSchema": {
"title": "admin/store.title",
Expand Down Expand Up @@ -88,10 +89,7 @@
"type": "string"
}
},
"required": [
"rel",
"href"
]
"required": ["rel", "href"]
},
"description": "admin/store.faviconLinks.description"
},
Expand All @@ -100,6 +98,23 @@
"type": "string",
"description": "admin/store.searchTermPath.description"
},
"includeTwitterMetaTags": {
"title": "Include Twitter meta tags",
edyespinal marked this conversation as resolved.
Show resolved Hide resolved
"type": "boolean"
},
"twitterUsername": {
"title": "Twitter username",
"description": "The username your business uses on Twitter, for example: VTEXcommerce. (Do not include the @ sign)",
"type": "string"
},
"twitterCard": {
"title": "Twitter Card",
"description": "Please choose the type for the Twitter Card",
"type": "string",
"default": "summary",
"enum": ["photo", "summary", "summary_large_image"],
"enumNames": ["Photo", "Summary", "Summmary Large Image"]
},
victorhmp marked this conversation as resolved.
Show resolved Hide resolved
"advancedSettings": {
"title": "admin/store.advancedSettings.title",
"type": "object",
Expand Down Expand Up @@ -215,18 +230,14 @@
{
"properties": {
"requiresAuthorization": {
"enum": [
false
]
"enum": [false]
}
}
},
{
"properties": {
"requiresAuthorization": {
"enum": [
true
]
"enum": [true]
},
"b2bEnabled": {
"title": "admin/store.b2benabled.title",
Expand All @@ -247,12 +258,7 @@
"b2bEnabled": {
"ui:disabled": "true"
},
"ui:order": [
"storeName",
"requiresAuthorization",
"b2bEnabled",
"*"
]
"ui:order": ["storeName", "requiresAuthorization", "b2bEnabled", "*"]
},
"$schema": "https://raw.githubusercontent.com/vtex/node-vtex-api/master/gen/manifest.schema"
}
4 changes: 4 additions & 0 deletions react/ProductWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
useRuntime,
} from 'vtex.render-runtime'
import { ProductOpenGraph } from 'vtex.open-graph'
import { TwitterMetaTags } from 'vtex.twitter-meta-tags'
import useProduct from 'vtex.product-context/useProduct'
import ProductContextProvider from 'vtex.product-context/ProductContextProvider'
import { Product as ProductStructuredData } from 'vtex.structured-data'
Expand All @@ -24,6 +25,9 @@ const Content = ({ listName, loading, children, childrenProps }) => {
loading={loading}
/>
{product && <ProductOpenGraph />}

{product && <TwitterMetaTags />}

{product && selectedItem && (
<ProductStructuredData product={product} selectedItem={selectedItem} />
)}
Expand Down