diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d6b167e6..b8022fb3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Added +- `Twitter meta tags` to all product pages. ## [2.120.0] - 2021-06-28 ### Changed diff --git a/manifest.json b/manifest.json index 19945ecb7..811085b3b 100644 --- a/manifest.json +++ b/manifest.json @@ -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", @@ -88,10 +89,7 @@ "type": "string" } }, - "required": [ - "rel", - "href" - ] + "required": ["rel", "href"] }, "description": "admin/store.faviconLinks.description" }, @@ -100,6 +98,10 @@ "type": "string", "description": "admin/store.searchTermPath.description" }, + "includeTwitterMetaTags": { + "title": "admin/store.includeTwitterMetaTags.title", + "type": "boolean" + }, "advancedSettings": { "title": "admin/store.advancedSettings.title", "type": "object", @@ -215,18 +217,14 @@ { "properties": { "requiresAuthorization": { - "enum": [ - false - ] + "enum": [false] } } }, { "properties": { "requiresAuthorization": { - "enum": [ - true - ] + "enum": [true] }, "b2bEnabled": { "title": "admin/store.b2benabled.title", @@ -237,6 +235,37 @@ } } ] + }, + "includeTwitterMetaTags": { + "oneOf": [ + { + "properties": { + "includeTwitterMetaTags": { + "enum": [false] + } + } + }, + { + "properties": { + "includeTwitterMetaTags": { + "enum": [true] + }, + "twitterUsername": { + "title": "admin/store.twitterUsername.title", + "description": "admin/store.twitterUsername.description", + "type": "string" + }, + "twitterCard": { + "title": "admin/store.twitterCard.title", + "description": "admin/store.twitterCard.description", + "type": "string", + "default": "summary", + "enum": ["summary", "summary_large_image"], + "enumNames": ["Summary", "Summary with Large Image"] + } + } + } + ] } } }, @@ -247,12 +276,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" } diff --git a/react/ProductWrapper.js b/react/ProductWrapper.js index defa3a4d9..0afdaeea5 100644 --- a/react/ProductWrapper.js +++ b/react/ProductWrapper.js @@ -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' @@ -24,6 +25,9 @@ const Content = ({ listName, loading, children, childrenProps }) => { loading={loading} /> {product && } + + {product && } + {product && selectedItem && ( )} diff --git a/react/__mocks__/vtex.twitter-meta-tags.js b/react/__mocks__/vtex.twitter-meta-tags.js new file mode 100644 index 000000000..77b5b214e --- /dev/null +++ b/react/__mocks__/vtex.twitter-meta-tags.js @@ -0,0 +1,3 @@ +import React from 'react' + +export const TwitterMetaTags = () =>
TwitterMetaTags