Skip to content

Commit

Permalink
Added talk with us button
Browse files Browse the repository at this point in the history
  • Loading branch information
lmammino committed Sep 12, 2017
1 parent 1d16152 commit 8000962
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 7 deletions.
11 changes: 6 additions & 5 deletions src/components/Menu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ class Menu extends Component {

<div id='navMenu-main' className={`navbar-menu ${this.state.burgerActive ? 'is-active' : ''}`}>
<div className='navbar-start'>
<a className='navbar-item ' href='#value-proposition'>Our offer</a>
<a className='navbar-item ' href='#why-serverless'>Why Serverless?</a>
<a className='navbar-item ' href='#curricula'>Curricula</a>
<a className='navbar-item ' href='#instructors'>Instructors</a>
<a className='navbar-item ' href='#talk-with-us'>Talk with us</a>
<a className='navbar-item' href='#value-proposition'>Our offer</a>
<a className='navbar-item' href='#why-serverless'>Why Serverless?</a>
<a className='navbar-item' href='#curricula'>Curricula</a>
<a className='navbar-item' href='#instructors'>Instructors</a>
<a className='navbar-item' href='#talk-with-us'>Talk with us</a>
<a className='navbar-item' href='#why-training'>ROI</a>
</div>
</div>
</nav>
Expand Down
5 changes: 5 additions & 0 deletions src/components/Site.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => (
<div>
Expand Down Expand Up @@ -45,6 +46,10 @@ if (window && document) {
window.onload = function () {
const root = document.getElementById('main')
render(<Content isClient />, root, root.firstChild)

if (window.location.href.indexOf('localhost') === -1) {
drift()
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/components/ValueProposition/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { h } from 'preact'
import planetaryIcon from '../icons/planetarysystem.svg'
import TalkWithUsButton from '../utils/TalkWithUsButton'

const ValueProposition = () =>
(<div>
Expand All @@ -19,7 +20,7 @@ const ValueProposition = () =>
Our practical curriculum includes the main serverless technologies like <strong>Lambda Functions</strong>, <strong>API gateway</strong>, <strong>Dynamo DB</strong>, <strong>S3</strong>, <strong>RDS</strong>, <strong>Cloudwatch</strong> and covers a variety of topics from the basic to advanced topics like <strong>networking</strong>, <strong>performance</strong>, <strong>security</strong>, <strong>troubleshooting</strong> and <strong>continuous delivery</strong>.
</p>
<p>
<a href='#' className='button is-info is-large'>Talk with us today</a>
<TalkWithUsButton />
</p>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/components/WhyTraining/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { h, Component } from 'preact'
import TalkWithUsButton from '../utils/TalkWithUsButton'
import flagIcon from '../icons/flagstarplanet.svg'

class WhyTraining extends Component {
Expand Down Expand Up @@ -96,7 +97,7 @@ class WhyTraining extends Component {
</div>
</div>
<p>
<a href='#' className='button is-info is-large'>Talk with us today</a>
<TalkWithUsButton />
</p>
</div>
</div>
Expand Down
8 changes: 8 additions & 0 deletions src/components/utils/TalkWithUsButton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { h } from 'preact'
import { openChat } from './drift'

const TalkWithUsButton = ({label = 'Talk with us today'}) => (
<a href='#' onClick={openChat} className='button is-info is-large'>{label}</a>
)

export default TalkWithUsButton
34 changes: 34 additions & 0 deletions src/components/utils/drift.js
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 8000962

Please sign in to comment.