From 1fe4f71907024c2c79db324dd8f8dd7a36a5859a Mon Sep 17 00:00:00 2001 From: Max Tyrrell Date: Fri, 28 May 2021 21:18:53 +0200 Subject: [PATCH] feat(ProductMini): add new ProductMini widget --- README.md | 2 +- index.js | 26 +++++++++++++++++-------- src/ProductMini.js | 47 ++++++++++++++++++++++++++++++++++++++++++++++ src/templates.js | 15 ++++++++------- 4 files changed, 74 insertions(+), 16 deletions(-) create mode 100644 src/ProductMini.js diff --git a/README.md b/README.md index 9c26de3..7c5620b 100644 --- a/README.md +++ b/README.md @@ -143,4 +143,4 @@ Filters reviews by stars ## Copyright -(c) 2020, Pittaca S.r.l.s. +(c) 2020, Dado Agency (Pty) Ltd; Pittaca S.r.l.s. diff --git a/index.js b/index.js index 8ad6211..5988873 100644 --- a/index.js +++ b/index.js @@ -1,9 +1,19 @@ -import Carousel from './src/Carousel'; -import Grid from './src/Grid'; -import Horizontal from './src/Horizontal'; -import List from './src/List'; -import MiniCarousel from './src/MiniCarousel'; -import MicroCombo from './src/MicroCombo'; -import MicroStar from './src/MicroStar'; +import Carousel from "./src/Carousel"; +import Grid from "./src/Grid"; +import Horizontal from "./src/Horizontal"; +import List from "./src/List"; +import MiniCarousel from "./src/MiniCarousel"; +import MicroCombo from "./src/MicroCombo"; +import MicroStar from "./src/MicroStar"; +import ProductMini from "./src/ProductMini"; -export { Carousel, Grid, Horizontal, List, MiniCarousel, MicroCombo, MicroStar }; +export { + Carousel, + Grid, + Horizontal, + List, + MiniCarousel, + MicroCombo, + MicroStar, + ProductMini, +}; diff --git a/src/ProductMini.js b/src/ProductMini.js new file mode 100644 index 0000000..3c65094 --- /dev/null +++ b/src/ProductMini.js @@ -0,0 +1,47 @@ +import React, { Fragment } from "react"; +import PropTypes from "prop-types"; +import templates from "./templates"; +import TrustpilotContainer from "./TrustpilotContainer"; +import useSitePluginOptions from "./hooks/useSitePluginOptions"; + +const ProductMini = ({ language, culture, theme, height, width, stars }) => { + const reference = React.createRef(); + const { business, username } = useSitePluginOptions(); + + return ( + + + + ); +}; + +ProductMini.propTypes = { + language: PropTypes.string, + culture: PropTypes.string, + theme: PropTypes.string, + height: PropTypes.string, + width: PropTypes.string, + stars: PropTypes.number, +}; + +ProductMini.defaultProps = { + language: "en", + culture: "US", + theme: "light", + height: "24px", + width: "100%", + stars: 5, +}; + +export default ProductMini; diff --git a/src/templates.js b/src/templates.js index 86991e7..5c71530 100644 --- a/src/templates.js +++ b/src/templates.js @@ -1,9 +1,10 @@ export default { - Carousel: '53aa8912dec7e10d38f59f36', - Grid: '539adbd6dec7e10e686debee', - Horizontal: '5406e65db0d04a09e042d5fc', - List: '539ad60defb9600b94d7df2c', - MiniCarousel: '539ad0ffdec7e10e686debd7', - MicroStar: '5419b732fbfb950b10de65e5', - MicroCombo: '5419b6ffb0d04a076446a9af', + Carousel: "53aa8912dec7e10d38f59f36", + Grid: "539adbd6dec7e10e686debee", + Horizontal: "5406e65db0d04a09e042d5fc", + List: "539ad60defb9600b94d7df2c", + MiniCarousel: "539ad0ffdec7e10e686debd7", + MicroStar: "5419b732fbfb950b10de65e5", + MicroCombo: "5419b6ffb0d04a076446a9af", + ProductMini: "54d39695764ea907c0f34825", };