Skip to content

Commit

Permalink
feat(landing): Add content to contact us mailto: link
Browse files Browse the repository at this point in the history
  • Loading branch information
Geoff Jacobsen committed Jul 8, 2020
1 parent c3e3c4c commit b12645f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
23 changes: 23 additions & 0 deletions packages/landing/src/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export class BasemapsUi {
this.bindProjectionButtons();
this.bindApiLinks();
this.bindMenuButton();
this.bindContactUsButton();

this.setCurrentProjection(this.basemaps.config.projection);
}
Expand All @@ -43,6 +44,28 @@ export class BasemapsUi {
this.sideNav = sideNav;
}

bindContactUsButton(): void {
const button = document.getElementById('contact-us');
if (button == null) {
throw new Error('Unable to find contact-us button');
}

button.onclick = () => {
const subject = 'Request Basemaps Developer Access';
const body = `
Give us a few key details to sign up for Developer Access to LINZ Basemaps. We will respond with your Apps' unique API key.
Your Name:
Your Email:
Your Service/App URL:
`;
location.href = `mailto:basemaps@linz.govt.nz?subject=${encodeURI(subject)}&body=${encodeURI(body)}`;
};
}

menuOnClick = (): void => {
if (this.sideNav.classList.contains('side-nav--opened')) {
gaEvent(GaEvent.Ui, 'menu:close', 1);
Expand Down
3 changes: 1 addition & 2 deletions packages/landing/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ <h6>Get an API Key</h6>

<h6>Developer Access</h6>
<p>Contact us for free API keys with better support for public web and mobile apps.</p>
<button id="contact-us" class="lui-button lui-button-tertiary"
onclick="location.href='mailto:basemaps@linz.govt.nz'">Contact us</button>
<button id="contact-us" class="lui-button lui-button-tertiary">Contact us</button>

<h6>About basemaps</h6>
<ul class=" info-links">
Expand Down

0 comments on commit b12645f

Please sign in to comment.