From db2fff5cdff9156a38853fe5c74610ce466978f8 Mon Sep 17 00:00:00 2001 From: Vinicius Alves Date: Tue, 9 Nov 2021 09:38:00 -0300 Subject: [PATCH 1/6] feat(ga-track): added GA config tracking to sileder dots and arrows --- package.json | 2 +- source/components/slider/slider-component.js | 44 ++++++++++++++++---- source/components/slider/slider.stories.js | 20 ++++++++- 3 files changed, 56 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index f9baab4b5..386515580 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@b2wads/grimorio-ui", "sideEffects": false, - "version": "10.0.1", + "version": "10.0.2-beta.0", "description": "UI just like magic", "main": "lib/index.js", "repository": "https://github.com/b2wads/grimorio-ui", diff --git a/source/components/slider/slider-component.js b/source/components/slider/slider-component.js index 45c4e5e1c..69da30ef0 100644 --- a/source/components/slider/slider-component.js +++ b/source/components/slider/slider-component.js @@ -27,8 +27,18 @@ class Slider extends PureComponent { className: PropTypes.string, dotsClassName: PropTypes.string, arrowClassName: PropTypes.string, + arrowsGAConfig: PropTypes.shape({ + category: PropTypes.string, + action: PropTypes.string, + label: PropTypes.string, + }), dots: PropTypes.bool, dotsBackground: PropTypes.bool, + dotsGAConfig: PropTypes.shape({ + category: PropTypes.string, + action: PropTypes.string, + label: PropTypes.string, + }), arrows: PropTypes.bool, autoplay: PropTypes.bool, delay: PropTypes.number, @@ -144,29 +154,47 @@ class Slider extends PureComponent { } } - renderArrows(arrowClassName) { + renderArrows(arrowClassName, arrowsGAConfig) { + const hasArrowsGAConfig = Object.keys(arrowsGAConfig || {}).length !== 0; return (
- -
); } - renderDots(children, dotsClassName, dotsBackground) { + renderDots(children, dotsClassName, dotsGAConfig, dotsBackground) { + const hasDotsGAConfig = Object.keys(dotsGAConfig || {}).length !== 0; const { current } = this.state; + return (