diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 117a28d..879b12d 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: 14 + node-version: 16 - name: CI run: npm ci @@ -25,7 +25,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: 14 + node-version: 16 registry-url: https://registry.npmjs.org/ - name: CI run: npm ci @@ -44,7 +44,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: 14 + node-version: 16 registry-url: https://npm.pkg.github.com/ - name: CI run: npm ci diff --git a/.npmignore b/.npmignore index 997d2c2..c9fb984 100644 --- a/.npmignore +++ b/.npmignore @@ -13,3 +13,4 @@ examples gatsby-plugin-trustpilot-widget.code-workspace .prettierignore .prettierrc +src diff --git a/README.md b/README.md index d8f7ad9..5ec9155 100644 --- a/README.md +++ b/README.md @@ -19,24 +19,7 @@ npm install @pittica/gatsby-plugin-trustpilot-widget ``` -## Configuration - -Edit your **gatsby-config.js**. - -```javascript -module.exports = { - plugins: [ - { - resolve: `@pittica/gatsby-plugin-trustpilot-widget`, - options: { - username: "USERNAME", - template: "TEMPLATE_ID", - business: "BUSINESSUNIT_ID" - } - }, - ], -} -``` +## Component Usage The _username_, _template_ and _business_ fields **are required**. @@ -50,8 +33,6 @@ You can get the data from the TrustBox in your businness panel on [Trustpilot](h ``` -## Component Usage - Import the component **TrustpilotReviews** in your component. ```javascript @@ -70,6 +51,9 @@ class MyComponent extends React.Component { theme="light" width="100%" height="52px" + template="TEMPLATE_ID" + business="BUSINESSUNIT_ID" + username="USERNAME" /> ) } @@ -85,9 +69,11 @@ The component has optional attributes which the user can use to set the aspect o Sets the language of the locale and the language of the API. ##### Default Value + `en` ##### Note + If you set the language attribute you have to set the _culture_ attribute too. #### culture @@ -95,9 +81,11 @@ If you set the language attribute you have to set the _culture_ attribute too. Sets the culture of the locale. ##### Default Value + `US` ##### Note + If you set the culture attribute you have to set the _language_ attribute too. #### theme @@ -105,10 +93,12 @@ If you set the culture attribute you have to set the _language_ attribute too. Sets the UI theme of the TrustBox. ##### Values -* `light` -* `dark` + +- `light` +- `dark` ##### Default value + `light` #### width @@ -116,6 +106,7 @@ Sets the UI theme of the TrustBox. Sets the width of the widget. ##### Default Value + `100%` #### height @@ -123,8 +114,21 @@ Sets the width of the widget. Sets the height of the widget. ##### Default Value + `52px` +#### template + +Indicates the template ID. + +#### business + +Indicates the business ID. + +#### username + +Indicates the username. + ## Copyright (c) 2020-2021, [Pittica S.r.l.](https://pittica.com). diff --git a/gatsby-node.js b/gatsby-node.js deleted file mode 100644 index a89026f..0000000 --- a/gatsby-node.js +++ /dev/null @@ -1,7 +0,0 @@ -exports.pluginOptionsSchema = ({ Joi }) => { - return Joi.object({ - username: Joi.string().required().description(`Trustpilot username.`), - template: Joi.string().required().description(`Trustpilot template ID.`), - business: Joi.string().required().description(`Trustpilot business unit ID.`) - }) -} diff --git a/gatsby-ssr.js b/gatsby-ssr.js deleted file mode 100644 index 74d35ce..0000000 --- a/gatsby-ssr.js +++ /dev/null @@ -1,13 +0,0 @@ -import React from "react" - -export function onRenderBody({ setHeadComponents }) { - setHeadComponents([ -