@capillarytech/cap-ui-utils 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/GA/index.js CHANGED
@@ -15,7 +15,7 @@ function _initialize(GAConfigs) {
15
15
  return;
16
16
  }
17
17
  if(GAConfigs.accessKey) {
18
- ReactGA.initialize(GAConfigs.accessKey); //UA-152081629-1
18
+ ReactGA.initialize(GAConfigs.accessKey,{debug: true,}); //UA-152081629-1
19
19
  }
20
20
  log("Cap GA initialized");
21
21
  }
@@ -1,9 +1,10 @@
1
- import { trackEvent } from 'react-ga';
2
1
 
2
+ // import ReactGA from 'react-ga';
3
+ import tracker from './tracker'
3
4
  let trackableEvents = {};
4
5
  let trackingStoppedAt = 0;
5
6
  let windowWasInActive = false;
6
-
7
+ const {trackEvent}= tracker;
7
8
  let addInactiveTimeToEvents = inActiveInterval => {
8
9
  Object.keys(trackableEvents).map(function(key) {
9
10
  console.log('tracker', 'adjusted timing for', key);
@@ -15,7 +16,6 @@ function startTimer(event) {
15
16
  console.log('tracker', 'Started timer for ', event);
16
17
  trackableEvents[event] = Date.now();
17
18
  }
18
-
19
19
  function stopTimer(event, options) {
20
20
  const timeTaken = Date.now() - (trackableEvents[event] || 0);
21
21
  delete trackableEvents[event];
@@ -1,6 +1,8 @@
1
1
  import ReactGA from 'react-ga';
2
2
 
3
- function trackEvent() {}
3
+ function trackEvent(options) {
4
+ ReactGA.event(options);
5
+ }
4
6
 
5
7
  function trackTiming() {}
6
8
 
package/index.js CHANGED
@@ -1 +1,2 @@
1
- export { default as Auth } from './auth';
1
+ export { default as Auth } from './auth';
2
+ export { default as GA } from './GA';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capillarytech/cap-ui-utils",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Utility functions shared accross all the modules",
5
5
  "main": "index.js",
6
6
  "scripts": {