cabana: demo behind url parameter

main
Andy Haden 2017-07-02 19:15:43 -07:00
parent 659601c18f
commit fe4ba0ede6
2 changed files with 16 additions and 5 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 KiB

View File

@ -14,6 +14,7 @@ require('core-js/fn/object/values');
import './index.css';
const routeFullName = getUrlParameter('route');
const demo = getUrlParameter('demo');
let props = {};
if(routeFullName) {
const [dongleId, route] = routeFullName.split('|');
@ -41,8 +42,18 @@ if(authTokenQueryParam !== null) {
props.githubAuthToken = fetchPersistedGithubAuthToken();
}
ReactDOM.render(
<CanExplorer
{...props} />,
document.getElementById('root')
);
if(routeFullName || demo) {
ReactDOM.render(
<CanExplorer
{...props} />,
document.getElementById('root')
);
} else {
const img = document.createElement('img');
img.src = process.env.PUBLIC_URL + '/img/cabana.jpg';
img.style.width = '100%';
const comment = document.createComment('7/6/17');
document.getElementById('root').appendChild(img);
document.getElementById('root').appendChild(comment);
}