diff --git a/src/components/Menu/index.js b/src/components/Menu/index.js index f035447..5bb42e4 100644 --- a/src/components/Menu/index.js +++ b/src/components/Menu/index.js @@ -36,11 +36,12 @@ class Menu extends Component { diff --git a/src/components/Site.js b/src/components/Site.js index dd0fcfa..cd2a245 100644 --- a/src/components/Site.js +++ b/src/components/Site.js @@ -9,6 +9,7 @@ import Curricula from './Curricula' import Instructors from './Instructors' import WhyTraining from './WhyTraining' import Footer from './Footer' +import drift from './utils/drift' const Content = () => (
@@ -45,6 +46,10 @@ if (window && document) { window.onload = function () { const root = document.getElementById('main') render(, root, root.firstChild) + + if (window.location.href.indexOf('localhost') === -1) { + drift() + } } } diff --git a/src/components/ValueProposition/index.js b/src/components/ValueProposition/index.js index 81fb6c9..668c592 100644 --- a/src/components/ValueProposition/index.js +++ b/src/components/ValueProposition/index.js @@ -1,5 +1,6 @@ import { h } from 'preact' import planetaryIcon from '../icons/planetarysystem.svg' +import TalkWithUsButton from '../utils/TalkWithUsButton' const ValueProposition = () => (
@@ -19,7 +20,7 @@ const ValueProposition = () => Our practical curriculum includes the main serverless technologies like Lambda Functions, API gateway, Dynamo DB, S3, RDS, Cloudwatch and covers a variety of topics from the basic to advanced topics like networking, performance, security, troubleshooting and continuous delivery.

- Talk with us today +

diff --git a/src/components/WhyTraining/index.js b/src/components/WhyTraining/index.js index 1071fbe..b9ee1ba 100644 --- a/src/components/WhyTraining/index.js +++ b/src/components/WhyTraining/index.js @@ -1,4 +1,5 @@ import { h, Component } from 'preact' +import TalkWithUsButton from '../utils/TalkWithUsButton' import flagIcon from '../icons/flagstarplanet.svg' class WhyTraining extends Component { @@ -96,7 +97,7 @@ class WhyTraining extends Component {

- Talk with us today +

diff --git a/src/components/utils/TalkWithUsButton.js b/src/components/utils/TalkWithUsButton.js new file mode 100644 index 0000000..949d0ae --- /dev/null +++ b/src/components/utils/TalkWithUsButton.js @@ -0,0 +1,8 @@ +import { h } from 'preact' +import { openChat } from './drift' + +const TalkWithUsButton = ({label = 'Talk with us today'}) => ( + {label} +) + +export default TalkWithUsButton diff --git a/src/components/utils/drift.js b/src/components/utils/drift.js new file mode 100644 index 0000000..fa32552 --- /dev/null +++ b/src/components/utils/drift.js @@ -0,0 +1,34 @@ +/* eslint-disable */ +const drift = () => { + !(function () { + var t + if (t = window.driftt = window.drift = window.driftt || [], !t.init) { + return t.invoked ? void (window.console && console.error && console.error('Drift snippet included twice.')) : (t.invoked = !0, + t.methods = [ 'identify', 'config', 'track', 'reset', 'debug', 'show', 'ping', 'page', 'hide', 'off', 'on' ], + t.factory = function (e) { + return function () { + var n + return n = Array.prototype.slice.call(arguments), n.unshift(e), t.push(n), t + } + }, t.methods.forEach(function (e) { + t[e] = t.factory(e) + }), t.load = function (t) { + var e, n, o, i + e = 3e5, i = Math.ceil(new Date() / e) * e, o = document.createElement('script'), + o.type = 'text/javascript', o.async = !0, o.crossorigin = 'anonymous', o.src = 'https://js.driftt.com/include/' + i + '/' + t + '.js', + n = document.getElementsByTagName('script')[0], n.parentNode.insertBefore(o, n) + }) + } + }()) + window.drift.SNIPPET_VERSION = '0.3.1' + window.drift.load('ava57h5bw28g') +} + +export const openChat = (e) => { + if (e && e.preventDefault) { + e.preventDefault() + } + window.drift.api.openChat() +} + +export default drift