Skip to content

Commit

Permalink
#93 - Added documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicola Parrello committed Mar 14, 2019
1 parent ca93663 commit 79c5257
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
GOOGLE_TAG_MANAGER_CONTAINER_ID=
GOOGLE_TAG_MANAGER_CONTAINER_ID=GTM-XXXXXX

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# misc
.DS_Store
.idea
.env

npm-debug.log*
yarn-debug.log*
Expand Down
23 changes: 12 additions & 11 deletions src/helpers/tracking.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @flow
/**
*/
export default function initializeCookieConsentBar() {
Expand Down Expand Up @@ -31,6 +32,17 @@ export default function initializeCookieConsentBar() {
});
}

/**
*/
function initializeAllTracking() {
initializeGoogleTagManagerIfNeeded();

window.removeEventListener("scroll", initializeAllTracking);
window.removeEventListener("keydown", initializeAllTracking);
window.removeEventListener("mousedown", initializeAllTracking);
window.removeEventListener("touchstart", initializeAllTracking);
}

/**
*/
function initializeGoogleTagManagerIfNeeded() {
Expand All @@ -52,14 +64,3 @@ function initializeGoogleTagManagerIfNeeded() {
}) (window, document, "script", "dataLayer", googleTagManagerContainerId);
}
}

/**
*/
function initializeAllTracking() {
initializeGoogleTagManagerIfNeeded();

window.removeEventListener("scroll", initializeAllTracking);
window.removeEventListener("keydown", initializeAllTracking);
window.removeEventListener("mousedown", initializeAllTracking);
window.removeEventListener("touchstart", initializeAllTracking);
}
11 changes: 5 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
// @flow
import SwaggerUIStandalonePreset from "swagger-ui";
import "../node_modules/cookieconsent/build/cookieconsent.min.js";
import "cookieconsent/build/cookieconsent.min.js";
import dotenv from "dotenv";

import initializeCookieConsentBar from "./helpers/tracking";
import registerServiceWorker from "./helpers/registerServiceWorker";

import "swagger-ui/dist/swagger-ui.css";

import {
BunqLayoutPlugin,
DisableTryItOutPlugin
} from "./plugins";
import initializeCookieConsentBar from "./helpers/tracking";
import registerServiceWorker from "./helpers/registerServiceWorker";

import "swagger-ui/dist/swagger-ui.css";
import "./scss/index.css";

dotenv.config();
Expand Down
9 changes: 7 additions & 2 deletions src/scss/_cookie-consent.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
@import "variables";
@import "~cookieconsent/build/cookieconsent.min.css";

$background-color-cookie-consent: #007AFF;
$border-button: 1px solid $color-white;
/* Sizes */
$min-width-button: 100px;
$size-cookie: 30px;

/* Borders */
$border-button: 1px solid $color-white;

/* Colors */
$background-color-cookie-consent: #007AFF;

.cc-grower {
margin: 0 $spacer-small * -1;
}
Expand Down

0 comments on commit 79c5257

Please sign in to comment.