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

Residential Parking Form (out of box Knack.js form embed) #271

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"react-load-script": "^0.0.6",
"react-router": "^4.2.0",
"react-router-dom": "^4.2.2",
"react-static": "^5.9.7",
"react-static": "^6.0.0-beta.26",
"react-universal-component": "^2.8.1",
"storybook": "^1.0.0",
"ua-parser-js": "^0.7.17",
Expand Down
30 changes: 30 additions & 0 deletions src/components/Pages/ResidentialParkingPermit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import React, { Component } from 'react';
import Script from 'react-load-script';

class ResidentialParkingPermit extends Component {
constructor(props) {
super(props);

window.app_id = '59d6d719ca658c3c38ba7191';
window.distribution_key = 'dist_3';
}

handleScriptLoad = () => {
console.log('Knack.js loaded');
};

render() {
return (
<section className="wrapper wrapper--sm">
<h1>🅿️ Residential Parking Permit Page</h1>️
<Script
url="https://loader.knack.com/59d6d719ca658c3c38ba7191/dist_3/knack.js"
onLoad={this.handleScriptLoad}
/>
<div id="knack-dist_3">Loading...</div>
</section>
);
}
}

export default ResidentialParkingPermit;
21 changes: 15 additions & 6 deletions static.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,11 @@ export default {
component: 'src/components/Pages/Search', //TODO: update search page to be conscious of all languages
},
{
is404: true,
path: '/forms/residential-parking-permit',
component: 'src/components/Pages/ResidentialParkingPermit',
},
{
path: '404',
component: 'src/components/Pages/404', //TODO: update 404 page to be conscious of all languages
},
];
Expand All @@ -236,13 +240,18 @@ export default {
return allRoutes;
},
webpack: (config, { stage }) => {
// Currently, we aren't running babel-polyfill because a 3rd party form
// embed has a conflict. See this Pull Request for more details:
// https://github.com/cityofaustin/janis/pull/271

// TODO: Reconfigure babel-polyfill so we support IE11
// Include babel poyfill for IE 11 and below
// https://github.com/nozzle/react-static/blob/811ebe1b5a5b8e24fffec99fcdb3375818383711/docs/concepts.md#browser-support
if (stage === 'prod') {
config.entry = ['babel-polyfill', config.entry];
} else if (stage === 'dev') {
config.entry = ['babel-polyfill', ...config.entry];
}
// if (stage === 'prod') {
// config.entry = ['babel-polyfill', config.entry];
// } else if (stage === 'dev') {
// config.entry = ['babel-polyfill', ...config.entry];
// }
return config;
},
};
Loading