Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Commit

Permalink
add hotjar and feeback google form btn (#5)
Browse files Browse the repository at this point in the history
* add hotjar and feeback google form btn

* externalise the hotjar id

Co-authored-by: Riccardo Noviello <riccardo.noviello@gmail.com>
  • Loading branch information
rik86future and riccardo-noviello authored Aug 14, 2020
1 parent 174d992 commit 8362147
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
export AIRTABLE_TABLE_NAMES=${AIRTABLE_TABLE_NAMES_INTEGRATION}
export ADDRESSES_API_URL=${ADDRESSES_API_URL}
export ADDRESSES_API_KEY=${ADDRESSES_API_KEY}
export HOTJAR_ID=${HOTJAR_ID}
export ALLOWED_GROUPS=xx
export NEXT_PUBLIC_SINGLEVIEW_URL=https://staging-singleview.hackney.gov.uk
CYPRESS_CACHE_FOLDER=~/repo/cypress_cache yarn run int-test
Expand Down
3 changes: 2 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ module.exports = {
},
env: {
ADDRESSES_API_URL: process.env.ADDRESSES_API_URL,
ADDRESSES_API_KEY: process.env.ADDRESSES_API_KEY
ADDRESSES_API_KEY: process.env.ADDRESSES_API_KEY,
HOTJAR_ID: process.env.HOTJAR_ID
},
distDir: 'build/_next',
target: 'server'
Expand Down
14 changes: 13 additions & 1 deletion pages/_document.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
import Document, { Html, Head, Main, NextScript } from 'next/document';

export default class AppDocument extends Document {

render() {
return (
<Html className="govuk-template lbh-template">
<Head />
<Head>
<script dangerouslySetInnerHTML={{ __html: `
(function(h,o,t,j,a,r){
h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
h._hjSettings={hjid:${process.env.HOTJAR_ID},hjsv:6};
a=o.getElementsByTagName('head')[0];
r=o.createElement('script');r.async=1;
r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
a.appendChild(r);
})(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');
`}} />
</Head>
<body className="govuk-template__body lbh-template__body js-enabled">
<Main />
<NextScript />
Expand Down
8 changes: 8 additions & 0 deletions pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ const Index = ({ resources, initialSnapshot, token }) => {
genericPostcode={postcode}
residentCoordinates={residentCoordinates}
/>

<a
href='https://forms.gle/mLq5Ugxtf2uPZQ3aA'
className="govuk-button"
data-testid="feedback-link-test"
>
Submit feedback
</a>
</>
);
};
Expand Down

0 comments on commit 8362147

Please sign in to comment.