Merge branch 'master' into galleryRedo2
|
@ -917,6 +917,11 @@
|
|||
"integrity": "sha512-FhlMa34NHp9K5MY1Uz8yb+ZvuX0pnvn3jScRSNAb75KHGB8d3rEU6hqMs3Z2vjuytcMfRg6c5CHMc3wtYyD2/A==",
|
||||
"optional": true
|
||||
},
|
||||
"@types/cookie": {
|
||||
"version": "0.3.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.3.2.tgz",
|
||||
"integrity": "sha512-aHQA072E10/8iUQsPH7mQU/KUyQBZAGzTVRCUvnSz8mSvbrYsP4xEO2RSA0Pjltolzi0j8+8ixrm//Hr4umPzw=="
|
||||
},
|
||||
"@types/form-data": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-2.2.1.tgz",
|
||||
|
@ -936,6 +941,14 @@
|
|||
"@types/request": "*"
|
||||
}
|
||||
},
|
||||
"@types/hoist-non-react-statics": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.0.1.tgz",
|
||||
"integrity": "sha512-3wTz66vV+WatOAjMST+hKCmo01KYPFgnsu+QeLcn0FuwPCoymX6aj1a4RvFCdVsfh2m0hfTPhE/zTv4M28ho1Q==",
|
||||
"requires": {
|
||||
"@types/react": "*"
|
||||
}
|
||||
},
|
||||
"@types/jss": {
|
||||
"version": "9.5.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/jss/-/jss-9.5.5.tgz",
|
||||
|
@ -961,6 +974,11 @@
|
|||
"resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.36.tgz",
|
||||
"integrity": "sha512-SL6KhfM7PTqiFmbCW3eVNwVBZ+88Mrzbuvn9olPsfv43mbiWaFY+nRcz/TGGku0/lc2FepdMbImdMY1JrQ+zbw=="
|
||||
},
|
||||
"@types/object-assign": {
|
||||
"version": "4.0.30",
|
||||
"resolved": "http://registry.npmjs.org/@types/object-assign/-/object-assign-4.0.30.tgz",
|
||||
"integrity": "sha1-iUk3HVqZ9Dge4PHfCpt6GH4H5lI="
|
||||
},
|
||||
"@types/prop-types": {
|
||||
"version": "15.5.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.5.5.tgz",
|
||||
|
@ -5661,7 +5679,7 @@
|
|||
},
|
||||
"core-js": {
|
||||
"version": "2.5.5",
|
||||
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.5.tgz",
|
||||
"resolved": "http://registry.npmjs.org/core-js/-/core-js-2.5.5.tgz",
|
||||
"integrity": "sha1-sU3ek2xkDAV5prUMq8wTLdYSfjs="
|
||||
},
|
||||
"firebase": {
|
||||
|
@ -12494,6 +12512,26 @@
|
|||
"schedule": "^0.4.0"
|
||||
}
|
||||
},
|
||||
"react-cookie": {
|
||||
"version": "3.0.7",
|
||||
"resolved": "https://registry.npmjs.org/react-cookie/-/react-cookie-3.0.7.tgz",
|
||||
"integrity": "sha512-c4lGOqIPC54kUocE7kbuqZNeIdXtZGzXQMA7BSWhaJ/5tWeoW5fJ7mF/pR+rU5fYDF9kktTHCIbovwSsNYblOg==",
|
||||
"requires": {
|
||||
"@types/hoist-non-react-statics": "^3.0.1",
|
||||
"hoist-non-react-statics": "^3.0.0",
|
||||
"universal-cookie": "^3.0.7"
|
||||
},
|
||||
"dependencies": {
|
||||
"hoist-non-react-statics": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.2.0.tgz",
|
||||
"integrity": "sha512-3IascCRfaEkbmHjJnUxWSspIUE1okLPjGTMVXW8zraUo1t3yg1BadKAxAGILHwgoBzmMnzrgeeaDGBvpuPz6dA==",
|
||||
"requires": {
|
||||
"react-is": "^16.3.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"react-dev-utils": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-5.0.2.tgz",
|
||||
|
@ -12577,6 +12615,11 @@
|
|||
"resize-observer-polyfill": "^1.5.0"
|
||||
}
|
||||
},
|
||||
"react-is": {
|
||||
"version": "16.6.3",
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.6.3.tgz",
|
||||
"integrity": "sha512-u7FDWtthB4rWibG/+mFbVd5FvdI20yde86qKGx4lVUTWmPlSWQ4QxbBIrrs+HnXGbxOUlUzTAP/VDmvCwaP2yA=="
|
||||
},
|
||||
"react-jss": {
|
||||
"version": "8.6.1",
|
||||
"resolved": "https://registry.npmjs.org/react-jss/-/react-jss-8.6.1.tgz",
|
||||
|
@ -14675,6 +14718,17 @@
|
|||
"crypto-random-string": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"universal-cookie": {
|
||||
"version": "3.0.7",
|
||||
"resolved": "https://registry.npmjs.org/universal-cookie/-/universal-cookie-3.0.7.tgz",
|
||||
"integrity": "sha512-wfZRbaEzFTDbP64fzTfGDfokB3pWkDNjtsuRAZQWaiuj/Up+3/0AEvN4IhFHPK24iGNtGJ6PNIxv1GQzMSiyMw==",
|
||||
"requires": {
|
||||
"@types/cookie": "^0.3.1",
|
||||
"@types/object-assign": "^4.0.30",
|
||||
"cookie": "^0.3.1",
|
||||
"object-assign": "^4.1.0"
|
||||
}
|
||||
},
|
||||
"universal-deep-strict-equal": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/universal-deep-strict-equal/-/universal-deep-strict-equal-1.2.2.tgz",
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
"material-ui-icons": "^1.0.0-beta.36",
|
||||
"moment": "^2.22.2",
|
||||
"react": "^16.5.1",
|
||||
"react-cookie": "^3.0.7",
|
||||
"react-dom": "^16.5.1",
|
||||
"react-image-gallery": "^0.8.12",
|
||||
"react-quiz-component": "0.2.0",
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
<head>
|
||||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-128154616-1"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag() { dataLayer.push(arguments); }
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', 'UA-128154616-1');
|
||||
gtag('config', 'UA-128154616-1');
|
||||
</script>
|
||||
|
||||
|
||||
|
@ -31,26 +32,25 @@
|
|||
work correctly both with client-side routing and a non-root public URL.
|
||||
Learn how to configure a non-root public URL by running `npm run build`.
|
||||
-->
|
||||
<title>Marten Tracker</title>
|
||||
</head>
|
||||
|
||||
<!--<script>import flamelink from 'flamelink';</script>-->
|
||||
|
||||
<title>React App</title>
|
||||
</head>
|
||||
<body>
|
||||
<body>
|
||||
<noscript>
|
||||
You need to enable JavaScript to run this app.
|
||||
You need to enable JavaScript to run this app.
|
||||
</noscript>
|
||||
<div id="root"></div>
|
||||
<!-- Hotjar Tracking Code for https://marten-application.netlify.com/ -->
|
||||
<script>
|
||||
(function(h,o,t,j,a,r){
|
||||
h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
|
||||
h._hjSettings={hjid:1066756,hjsv:6};
|
||||
a=o.getElementsByTagName('head')[0];
|
||||
r=o.createElement('script');r.async=1;
|
||||
r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
|
||||
(function (h, o, t, j, a, r) {
|
||||
h.hj = h.hj || function () { (h.hj.q = h.hj.q || []).push(arguments) };
|
||||
h._hjSettings = { hjid: 1066756, 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=');
|
||||
})(window, document, 'https://static.hotjar.com/c/hotjar-', '.js?sv=');
|
||||
</script>
|
||||
</body>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"short_name": "React App",
|
||||
"name": "Create React App Sample",
|
||||
"short_name": "Marten Tracker",
|
||||
"name": "American Marten Tracker",
|
||||
"icons": [
|
||||
{
|
||||
"src": "favicon.ico",
|
||||
|
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 83 KiB |
Before Width: | Height: | Size: 460 KiB After Width: | Height: | Size: 460 KiB |
Before Width: | Height: | Size: 805 KiB After Width: | Height: | Size: 805 KiB |
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
Before Width: | Height: | Size: 538 KiB After Width: | Height: | Size: 538 KiB |
Before Width: | Height: | Size: 259 KiB After Width: | Height: | Size: 259 KiB |
Before Width: | Height: | Size: 244 KiB After Width: | Height: | Size: 244 KiB |
Before Width: | Height: | Size: 484 KiB After Width: | Height: | Size: 484 KiB |
Before Width: | Height: | Size: 319 KiB After Width: | Height: | Size: 319 KiB |
Before Width: | Height: | Size: 185 KiB After Width: | Height: | Size: 185 KiB |
Before Width: | Height: | Size: 373 KiB After Width: | Height: | Size: 373 KiB |
Before Width: | Height: | Size: 270 KiB After Width: | Height: | Size: 270 KiB |
Before Width: | Height: | Size: 731 KiB After Width: | Height: | Size: 731 KiB |
Before Width: | Height: | Size: 444 KiB After Width: | Height: | Size: 444 KiB |
Before Width: | Height: | Size: 253 KiB After Width: | Height: | Size: 253 KiB |
Before Width: | Height: | Size: 193 KiB After Width: | Height: | Size: 193 KiB |
Before Width: | Height: | Size: 191 KiB After Width: | Height: | Size: 191 KiB |
Before Width: | Height: | Size: 235 KiB After Width: | Height: | Size: 235 KiB |
Before Width: | Height: | Size: 245 KiB After Width: | Height: | Size: 245 KiB |
Before Width: | Height: | Size: 712 KiB After Width: | Height: | Size: 712 KiB |
Before Width: | Height: | Size: 608 KiB After Width: | Height: | Size: 608 KiB |
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
Before Width: | Height: | Size: 236 KiB After Width: | Height: | Size: 236 KiB |
Before Width: | Height: | Size: 521 KiB After Width: | Height: | Size: 521 KiB |
Before Width: | Height: | Size: 446 KiB After Width: | Height: | Size: 446 KiB |
Before Width: | Height: | Size: 447 KiB After Width: | Height: | Size: 447 KiB |
Before Width: | Height: | Size: 168 KiB After Width: | Height: | Size: 168 KiB |
Before Width: | Height: | Size: 496 KiB After Width: | Height: | Size: 496 KiB |
Before Width: | Height: | Size: 226 KiB After Width: | Height: | Size: 226 KiB |
Before Width: | Height: | Size: 492 KiB After Width: | Height: | Size: 492 KiB |
Before Width: | Height: | Size: 164 KiB After Width: | Height: | Size: 164 KiB |
Before Width: | Height: | Size: 152 KiB After Width: | Height: | Size: 152 KiB |
Before Width: | Height: | Size: 446 KiB After Width: | Height: | Size: 446 KiB |
Before Width: | Height: | Size: 252 KiB After Width: | Height: | Size: 252 KiB |
Before Width: | Height: | Size: 434 KiB After Width: | Height: | Size: 434 KiB |
Before Width: | Height: | Size: 782 KiB After Width: | Height: | Size: 782 KiB |
Before Width: | Height: | Size: 1000 KiB After Width: | Height: | Size: 1000 KiB |
Before Width: | Height: | Size: 507 KiB After Width: | Height: | Size: 507 KiB |
Before Width: | Height: | Size: 754 KiB After Width: | Height: | Size: 754 KiB |
Before Width: | Height: | Size: 363 KiB After Width: | Height: | Size: 363 KiB |
Before Width: | Height: | Size: 230 KiB After Width: | Height: | Size: 230 KiB |
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
Before Width: | Height: | Size: 453 KiB After Width: | Height: | Size: 453 KiB |
Before Width: | Height: | Size: 460 KiB After Width: | Height: | Size: 460 KiB |
Before Width: | Height: | Size: 270 KiB After Width: | Height: | Size: 270 KiB |
Before Width: | Height: | Size: 290 KiB After Width: | Height: | Size: 290 KiB |
Before Width: | Height: | Size: 379 KiB After Width: | Height: | Size: 379 KiB |
Before Width: | Height: | Size: 1012 KiB After Width: | Height: | Size: 1012 KiB |
Before Width: | Height: | Size: 247 KiB After Width: | Height: | Size: 247 KiB |
Before Width: | Height: | Size: 246 KiB After Width: | Height: | Size: 246 KiB |
Before Width: | Height: | Size: 806 KiB After Width: | Height: | Size: 806 KiB |
Before Width: | Height: | Size: 504 KiB After Width: | Height: | Size: 504 KiB |
Before Width: | Height: | Size: 378 KiB After Width: | Height: | Size: 378 KiB |
Before Width: | Height: | Size: 413 KiB After Width: | Height: | Size: 413 KiB |
Before Width: | Height: | Size: 722 KiB After Width: | Height: | Size: 722 KiB |
Before Width: | Height: | Size: 252 KiB After Width: | Height: | Size: 252 KiB |
Before Width: | Height: | Size: 380 KiB After Width: | Height: | Size: 380 KiB |
Before Width: | Height: | Size: 380 KiB After Width: | Height: | Size: 380 KiB |
Before Width: | Height: | Size: 773 KiB After Width: | Height: | Size: 773 KiB |
Before Width: | Height: | Size: 694 KiB After Width: | Height: | Size: 694 KiB |
|
@ -24,5 +24,6 @@ The application allows for users to post marten sightings. They can attach photo
|
|||
* Material-UI
|
||||
* Google API
|
||||
* Netlify
|
||||
* Disqus
|
||||
* Flamelink CMS
|
||||
* EmailJS
|
||||
|
|
11
src/App.js
|
@ -1,6 +1,7 @@
|
|||
import React, { Component } from 'react';
|
||||
import Main from './components/Main';
|
||||
import './App.css';
|
||||
import './css/App.css';
|
||||
import { CookiesProvider } from 'react-cookie';
|
||||
|
||||
class App extends Component {
|
||||
componentDidMount() {
|
||||
|
@ -9,9 +10,11 @@ class App extends Component {
|
|||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<Main/>
|
||||
</div>
|
||||
<CookiesProvider>
|
||||
<div>
|
||||
<Main />
|
||||
</div>
|
||||
</CookiesProvider>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import PropTypes, { instanceOf } from 'prop-types';
|
||||
import { withStyles } from '@material-ui/core/styles';
|
||||
import Drawer from '@material-ui/core/Drawer';
|
||||
import AppBar from '@material-ui/core/AppBar';
|
||||
|
@ -32,7 +32,10 @@ import CssBaseline from '@material-ui/core/CssBaseline';
|
|||
import ExpandLess from '@material-ui/icons/ExpandLess';
|
||||
import ExpandMore from '@material-ui/icons/ExpandMore';
|
||||
import Collapse from '@material-ui/core/Collapse';
|
||||
import FlameLinkCollectionGallery from '../components/FlameLinkCollectionGallery';
|
||||
import FlameLinkCollectionGallery from '../components/flamelink/FlameLinkCollectionGallery';
|
||||
import { MuiThemeProvider, createMuiTheme } from '@material-ui/core/styles';
|
||||
import Switch from '@material-ui/core/Switch';
|
||||
import { withCookies, Cookies } from 'react-cookie';
|
||||
|
||||
const drawerWidth = 240;
|
||||
|
||||
|
@ -72,23 +75,71 @@ const styles = theme => ({
|
|||
});
|
||||
|
||||
class ResponsiveDrawer extends React.Component {
|
||||
state = {
|
||||
mobileOpen: false,
|
||||
key: 'Home',
|
||||
open: false,
|
||||
open2: false,
|
||||
};
|
||||
componentWillMount() {
|
||||
const { cookies } = this.props;
|
||||
|
||||
var newName, newTheme, newChecked;
|
||||
|
||||
if (cookies.get('themeName') === undefined) {
|
||||
newName = 'light'
|
||||
newTheme = createMuiTheme({
|
||||
typography: {
|
||||
useNextVariants: true,
|
||||
},
|
||||
palette: {
|
||||
type: 'light'
|
||||
}
|
||||
});
|
||||
newChecked = true;
|
||||
|
||||
cookies.set('themeName', newName, { path: '/' });
|
||||
} else {
|
||||
if (cookies.get('themeName') === 'light') {
|
||||
newName = 'light'
|
||||
newTheme = createMuiTheme({
|
||||
typography: {
|
||||
useNextVariants: true,
|
||||
},
|
||||
palette: {
|
||||
type: 'light'
|
||||
}
|
||||
});
|
||||
newChecked = true;
|
||||
} else {
|
||||
newName = 'dark'
|
||||
newTheme = createMuiTheme({
|
||||
typography: {
|
||||
useNextVariants: true,
|
||||
},
|
||||
palette: {
|
||||
type: 'dark'
|
||||
}
|
||||
});
|
||||
newChecked = false;
|
||||
}
|
||||
}
|
||||
|
||||
this.setState({
|
||||
mobileOpen: false,
|
||||
key: 'Home',
|
||||
open: false,
|
||||
open2: false,
|
||||
theme: newTheme,
|
||||
themeName: newName,
|
||||
themeChecked: newChecked
|
||||
});
|
||||
}
|
||||
|
||||
handleDrawerToggle = () => {
|
||||
this.setState(state => ({ mobileOpen: !state.mobileOpen }));
|
||||
}
|
||||
|
||||
handleClick = () => {
|
||||
this.setState(state => ({ open: !state.open }));
|
||||
this.setState(state => ({ open: !state.open, open2: false }));
|
||||
}
|
||||
|
||||
handleClick2 = () => {
|
||||
this.setState(state => ({ open2: !state.open2 }));
|
||||
this.setState(state => ({ open2: !state.open2, open: false }));
|
||||
}
|
||||
|
||||
nav = (text) => {
|
||||
|
@ -97,11 +148,50 @@ class ResponsiveDrawer extends React.Component {
|
|||
});
|
||||
}
|
||||
|
||||
handleChange = name => event => {
|
||||
const { cookies } = this.props;
|
||||
|
||||
this.setState({ [name]: event.target.checked });
|
||||
|
||||
var newTheme, newName;
|
||||
|
||||
if (this.state.themeName === 'light') {
|
||||
newTheme = createMuiTheme({
|
||||
typography: {
|
||||
useNextVariants: true,
|
||||
},
|
||||
palette: {
|
||||
type: 'dark'
|
||||
}
|
||||
});
|
||||
|
||||
newName = 'dark';
|
||||
} else {
|
||||
newTheme = createMuiTheme({
|
||||
typography: {
|
||||
useNextVariants: true,
|
||||
},
|
||||
palette: {
|
||||
type: 'light'
|
||||
}
|
||||
});
|
||||
|
||||
newName = 'light';
|
||||
}
|
||||
|
||||
this.setState({
|
||||
themeName: newName,
|
||||
theme: newTheme
|
||||
})
|
||||
|
||||
cookies.set('themeName', newName, { path: '/' });
|
||||
};
|
||||
|
||||
render() {
|
||||
const { classes, theme } = this.props;
|
||||
const { classes } = this.props;
|
||||
|
||||
const drawer = (
|
||||
<div>
|
||||
<Typography component="div">
|
||||
<div className={classes.toolbar} />
|
||||
<Divider />
|
||||
<List>
|
||||
|
@ -174,84 +264,91 @@ class ResponsiveDrawer extends React.Component {
|
|||
</Collapse>
|
||||
</List>
|
||||
<Divider />
|
||||
</div>
|
||||
</Typography>
|
||||
);
|
||||
|
||||
return (
|
||||
<div className={classes.root}>
|
||||
<CssBaseline />
|
||||
<AppBar position="fixed" className={classes.appBar}>
|
||||
<Toolbar>
|
||||
<IconButton
|
||||
color="inherit"
|
||||
aria-label="Open drawer"
|
||||
onClick={this.handleDrawerToggle}
|
||||
className={classes.menuButton}
|
||||
>
|
||||
<MenuIcon />
|
||||
</IconButton>
|
||||
<Typography variant="title" color="inherit" noWrap>
|
||||
Marten Tracker
|
||||
</Typography>
|
||||
</Toolbar>
|
||||
</AppBar>
|
||||
<nav className={classes.drawer}>
|
||||
<Hidden smUp implementation="css">
|
||||
<Drawer
|
||||
container={this.props.container}
|
||||
variant="temporary"
|
||||
anchor={theme.direction === 'rtl' ? 'right' : 'left'}
|
||||
open={this.state.mobileOpen}
|
||||
onClose={this.handleDrawerToggle}
|
||||
classes={{
|
||||
paper: classes.drawerPaper,
|
||||
}}
|
||||
ModalProps={{
|
||||
keepMounted: true, // Better open performance on mobile.
|
||||
}}
|
||||
>
|
||||
{drawer}
|
||||
</Drawer>
|
||||
</Hidden>
|
||||
<Hidden xsDown implementation="css">
|
||||
<Drawer
|
||||
classes={{
|
||||
paper: classes.drawerPaper,
|
||||
}}
|
||||
variant="permanent"
|
||||
open
|
||||
>
|
||||
{drawer}
|
||||
</Drawer>
|
||||
</Hidden>
|
||||
</nav>
|
||||
<main className={classes.content}>
|
||||
<div className={classes.toolbar} />
|
||||
{this.state.key === 'Home' && <Home />}
|
||||
{this.state.key === 'Report' && <Report />}
|
||||
{this.state.key === 'Map' && <ViewMap />}
|
||||
{this.state.key === 'List' && <SightingList />}
|
||||
{this.state.key === 'About' && <About />}
|
||||
{this.state.key === 'Contact' && <Contact />}
|
||||
{this.state.key === 'Easy-Quiz' && <Quiz difficulty='Easy'/>}
|
||||
{this.state.key === 'Intermediate-Quiz' && <Quiz difficulty='Intermediate'/>}
|
||||
{this.state.key === 'Advanced-Quiz' && <Quiz difficulty='Advanced'/>}
|
||||
{this.state.key === 'Gallery1' && <FlameLinkCollectionGallery galleryName={'martensAndKits'}/>}
|
||||
{this.state.key === 'Gallery2' && <FlameLinkCollectionGallery galleryName={'martensAtNight'}/>}
|
||||
{this.state.key === 'Gallery3' && <FlameLinkCollectionGallery galleryName={'martensBeingMartens'}/>}
|
||||
{this.state.key === 'Gallery4' && <FlameLinkCollectionGallery galleryName={'similarSpecies'}/>}
|
||||
</main>
|
||||
</div>
|
||||
<MuiThemeProvider theme={this.state.theme}>
|
||||
<div className={classes.root}>
|
||||
<CssBaseline />
|
||||
<AppBar position="fixed" color="primary" className={classes.appBar}>
|
||||
<Toolbar>
|
||||
<IconButton
|
||||
color="inherit"
|
||||
aria-label="Open drawer"
|
||||
onClick={this.handleDrawerToggle}
|
||||
className={classes.menuButton}
|
||||
>
|
||||
<MenuIcon />
|
||||
</IconButton>
|
||||
<Typography variant="title" color="inherit" noWrap>
|
||||
Marten Tracker
|
||||
</Typography>
|
||||
<Switch
|
||||
checked={this.state.themeChecked}
|
||||
onChange={this.handleChange('themeChecked')}
|
||||
value="themeChecked"
|
||||
color="default"
|
||||
/>
|
||||
</Toolbar>
|
||||
</AppBar>
|
||||
<nav className={classes.drawer}>
|
||||
<Hidden smUp implementation="css">
|
||||
<Drawer
|
||||
container={this.props.container}
|
||||
variant="temporary"
|
||||
anchor={this.state.theme.direction === 'rtl' ? 'right' : 'left'}
|
||||
open={this.state.mobileOpen}
|
||||
onClose={this.handleDrawerToggle}
|
||||
classes={{
|
||||
paper: classes.drawerPaper,
|
||||
}}
|
||||
ModalProps={{
|
||||
keepMounted: true, // Better open performance on mobile.
|
||||
}}
|
||||
>
|
||||
{drawer}
|
||||
</Drawer>
|
||||
</Hidden>
|
||||
<Hidden xsDown implementation="css">
|
||||
<Drawer
|
||||
classes={{
|
||||
paper: classes.drawerPaper,
|
||||
}}
|
||||
variant="permanent"
|
||||
open
|
||||
>
|
||||
{drawer}
|
||||
</Drawer>
|
||||
</Hidden>
|
||||
</nav>
|
||||
<main className={classes.content}>
|
||||
<div className={classes.toolbar} />
|
||||
{this.state.key === 'Home' && <Home />}
|
||||
{this.state.key === 'Report' && <Report />}
|
||||
{this.state.key === 'Map' && <ViewMap />}
|
||||
{this.state.key === 'List' && <SightingList themeName={this.state.themeName} />}
|
||||
{this.state.key === 'About' && <About />}
|
||||
{this.state.key === 'Contact' && <Contact />}
|
||||
{this.state.key === 'Easy-Quiz' && <Quiz difficulty='Easy' />}
|
||||
{this.state.key === 'Intermediate-Quiz' && <Quiz difficulty='Intermediate' />}
|
||||
{this.state.key === 'Advanced-Quiz' && <Quiz difficulty='Advanced' />}
|
||||
{this.state.key === 'Gallery1' && <FlameLinkCollectionGallery galleryName={'martensAndKits'} />}
|
||||
{this.state.key === 'Gallery2' && <FlameLinkCollectionGallery galleryName={'martensAtNight'} />}
|
||||
{this.state.key === 'Gallery3' && <FlameLinkCollectionGallery galleryName={'martensBeingMartens'} />}
|
||||
{this.state.key === 'Gallery4' && <FlameLinkCollectionGallery galleryName={'similarSpecies'} />}
|
||||
</main>
|
||||
</div>
|
||||
</MuiThemeProvider>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
ResponsiveDrawer.propTypes = {
|
||||
classes: PropTypes.object.isRequired,
|
||||
// Injected by the documentation to work in an iframe.
|
||||
// You won't need it on your project.
|
||||
container: PropTypes.object,
|
||||
theme: PropTypes.object.isRequired,
|
||||
cookies: instanceOf(Cookies).isRequired,
|
||||
};
|
||||
|
||||
export default withStyles(styles, { withTheme: true })(ResponsiveDrawer);
|
||||
export default withStyles(styles, { withTheme: true })(withCookies(ResponsiveDrawer));
|
|
@ -2,7 +2,7 @@ import React, { Component, Fragment } from 'react';
|
|||
import { Map, InfoWindow, Marker, GoogleApiWrapper } from 'google-maps-react';
|
||||
import moment from 'moment';
|
||||
import Typography from '@material-ui/core/Typography';
|
||||
import firebase from '../firebase.js';
|
||||
import firebase from '../utilities/firebase.js';
|
||||
|
||||
// Google Maps API Key
|
||||
const API_KEY = 'AIzaSyAZ_0J01bA6wCbIPK4UBq2RUBC-hIqG4mM';
|
||||
|
@ -216,22 +216,22 @@ export class MapContainer extends Component {
|
|||
|
||||
switch(type) {
|
||||
case 'visual':
|
||||
pinIcon = '/mapicons/marten-icon.png';
|
||||
pinIcon = '/map-icons/marten-icon.png';
|
||||
break;
|
||||
case 'roadkill':
|
||||
pinIcon = '/mapicons/tire-icon.png';
|
||||
pinIcon = '/map-icons/tire-icon.png';
|
||||
break;
|
||||
case 'viewed_tracks':
|
||||
pinIcon = '/mapicons/paws.png';
|
||||
pinIcon = '/map-icons/paws.png';
|
||||
break;
|
||||
case 'trapped':
|
||||
pinIcon = '/mapicons/cage.png';
|
||||
pinIcon = '/map-icons/cage.png';
|
||||
break;
|
||||
case 'photo':
|
||||
pinIcon = '/mapicons/photo-icon.png';
|
||||
pinIcon = '/map-icons/photo-icon.png';
|
||||
break;
|
||||
case 'other':
|
||||
pinIcon = '/mapicons/other-icon.png';
|
||||
pinIcon = '/map-icons/other-icon.png';
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React, { Component} from 'react';
|
||||
import flamelinkApp from '../flamelink.js';
|
||||
import flamelinkApp from '../../utilities/flamelink.js';
|
||||
import FlameLinkCollectionComponentCreations from './FlameLinkCollectionComponentCreations';
|
||||
|
||||
class FlameLinkCollection extends Component {
|
|
@ -3,10 +3,10 @@ import Typography from '@material-ui/core/Typography';
|
|||
import Grid from '@material-ui/core/Grid';
|
||||
import { withStyles } from '@material-ui/core/styles';
|
||||
import RenderGallery from './RenderGallery';
|
||||
import flamelinkApp from '../flamelink.js';
|
||||
import flamelinkApp from '../../utilities/flamelink.js';
|
||||
import FlameLinkCollectionGalleryContent from './FlameLinkCollectionGalleryContent';
|
||||
import "react-image-gallery/styles/css/image-gallery.css";
|
||||
import '../css/FlameLink.css';
|
||||
import '../../css/FlameLink.css';
|
||||
|
||||
const styles = theme => ({
|
||||
flamelinkItem: {
|
|
@ -1,6 +1,6 @@
|
|||
import { Component } from 'react';
|
||||
import flamelinkApp from '../flamelink.js';
|
||||
import '../css/FlameLink.css';
|
||||
import flamelinkApp from '../../utilities/flamelink.js';
|
||||
import '../../css/FlameLink.css';
|
||||
|
||||
class FlameLinkCollectionGalleryContent extends Component {
|
||||
constructor(props) {
|
|
@ -2,7 +2,7 @@ import React, { Component} from 'react';
|
|||
import Grid from '@material-ui/core/Grid';
|
||||
import Typography from '@material-ui/core/Typography';
|
||||
import { withStyles } from '@material-ui/core/styles';
|
||||
import flamelinkApp from '../flamelink.js';
|
||||
import flamelinkApp from '../../utilities/flamelink.js';
|
||||
import FlameLinkImage from './FlameLinkImage';
|
||||
import FlameLinkFieldSet from './FlameLinkFieldSet';
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import React, { Component } from 'react';
|
||||
import Typography from '@material-ui/core/Typography';
|
||||
import flamelinkApp from '../flamelink.js';
|
||||
import '../css/FlameLink.css';
|
||||
import flamelinkApp from '../../utilities/flamelink.js';
|
||||
import '../../css/FlameLink.css';
|
||||
|
||||
class FlameLinkImage extends Component {
|
||||
constructor() {
|
|
@ -2,7 +2,7 @@ import React, { Component} from 'react';
|
|||
import Grid from '@material-ui/core/Grid';
|
||||
import Typography from '@material-ui/core/Typography';
|
||||
import { withStyles } from '@material-ui/core/styles';
|
||||
import flamelinkApp from '../flamelink.js';
|
||||
import flamelinkApp from '../../utilities/flamelink.js';
|
||||
import FlameLinkImage from './FlameLinkImage';
|
||||
import FlameLinkFieldSet from './FlameLinkFieldSet';
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import React, { Component } from 'react';
|
||||
import ImageGallery from 'react-image-gallery';
|
||||
import "react-image-gallery/styles/css/image-gallery.css";
|
||||
import '../css/FlameLink.css';
|
||||
import '../../css/FlameLink.css';
|
||||
|
||||
class RenderGallery extends Component {
|
||||
constructor() {
|
|
@ -1,7 +1,7 @@
|
|||
import React, { Fragment } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import Grid from '@material-ui/core/Grid';
|
||||
import emailjs from '../emailjs.js'
|
||||
import emailjs from '../../utilities/emailjs.js'
|
||||
import { withStyles } from '@material-ui/core/styles';
|
||||
import TextField from '@material-ui/core/TextField';
|
||||
import CheckCircleIcon from '@material-ui/icons/CheckCircle';
|
|
@ -9,8 +9,8 @@ import Snackbar from '@material-ui/core/Snackbar';
|
|||
import IconButton from '@material-ui/core/IconButton';
|
||||
import CloseIcon from '@material-ui/icons/Close';
|
||||
import Button from '@material-ui/core/Button';
|
||||
import firebase from '../firebase.js';
|
||||
import GoogleMap from '../components/ReportMap';
|
||||
import firebase from '../../utilities/firebase.js';
|
||||
import GoogleMap from './ReportMap';
|
||||
import Modal from '@material-ui/core/Modal';
|
||||
import Typography from '@material-ui/core/Typography';
|
||||
|
|
@ -2,13 +2,19 @@ import React, { Component, Fragment } from 'react';
|
|||
import Disqus from 'disqus-react';
|
||||
import moment from 'moment';
|
||||
import SightingDetailMap from './SightingDetailMap';
|
||||
import Typography from '@material-ui/core/Typography';
|
||||
import { withStyles } from '@material-ui/core/styles';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
const styles = theme => ({
|
||||
});
|
||||
|
||||
/**
|
||||
* Types of sightings. Label is what is
|
||||
* viewed in the application, value is
|
||||
* what is stored in the database.
|
||||
*/
|
||||
const sightingTypes = [
|
||||
const sightingTypes = [
|
||||
{
|
||||
value: 'visual',
|
||||
label: 'Visual',
|
||||
|
@ -143,18 +149,24 @@ class SightingDetail extends Component {
|
|||
return (
|
||||
<Fragment>
|
||||
<SightingDetailMap lat={this.props.detail.lat} lng={this.props.detail.lng} />
|
||||
<Typography component="div">
|
||||
<div className='sighting-details-content'>
|
||||
<p><b>Type:</b> {this.getType(this.props.detail.type)}</p>
|
||||
<p><b>When:</b> {this.formatDate(this.props.detail.date)}, {this.getTime(this.props.detail.time)}</p>
|
||||
<p><b>Where:</b> {this.props.detail.lat} degrees N, and {this.props.detail.lng} degrees E</p>
|
||||
<p><b>I am confident of my sighting:</b> {this.getConfidence(this.props.detail.confidence)}</p>
|
||||
<hr/>
|
||||
<hr />
|
||||
<p>{`${this.props.detail.desc}`}</p>
|
||||
</div>
|
||||
<Disqus.DiscussionEmbed shortname={disqusShortname} config={disqusConfig} />
|
||||
<Disqus.DiscussionEmbed shortname={disqusShortname} config={disqusConfig} />
|
||||
</Typography>
|
||||
</Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default SightingDetail;
|
||||
SightingDetail.propTypes = {
|
||||
classes: PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
export default withStyles(styles)(SightingDetail);
|
|
@ -1,6 +1,6 @@
|
|||
import React, { Component, Fragment } from 'react';
|
||||
import Grid from '@material-ui/core/Grid';
|
||||
import firebase from '../firebase.js';
|
||||
import firebase from '../../utilities/firebase.js';
|
||||
import List from '@material-ui/core/List';
|
||||
import ListItem from '@material-ui/core/ListItem';
|
||||
import ListItemText from '@material-ui/core/ListItemText';
|
||||
|
@ -64,6 +64,24 @@ class ViewSightings extends Component {
|
|||
clicked: false
|
||||
};
|
||||
|
||||
componentDidUpdate(props) {
|
||||
if (this.props.themeName !== props.themeName) {
|
||||
this.setState({
|
||||
selectedSighting: {
|
||||
id: null,
|
||||
lat: null,
|
||||
lng: null,
|
||||
desc: null,
|
||||
type: null,
|
||||
confidence: null,
|
||||
date: null,
|
||||
time: null
|
||||
},
|
||||
clicked: false
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Fragment>
|
||||
|
@ -71,20 +89,20 @@ class ViewSightings extends Component {
|
|||
<Grid item xs={12} md={6} className='sighting-list'>
|
||||
<Fragment>
|
||||
<List>
|
||||
{
|
||||
this.state.sightings.map((sighting) => {
|
||||
return (
|
||||
<ListItem button key={ sighting.id } onClick={() => this.getDetail(sighting.id, sighting.lat, sighting.lng, sighting.desc, sighting.type, sighting.confidence, sighting.date, sighting.time)}>
|
||||
<ListItemText primary={`${sighting.desc}`}/>
|
||||
</ListItem>
|
||||
);
|
||||
})
|
||||
}
|
||||
{
|
||||
this.state.sightings.map((sighting) => {
|
||||
return (
|
||||
<ListItem button key={sighting.id} onClick={() => this.getDetail(sighting.id, sighting.lat, sighting.lng, sighting.desc, sighting.type, sighting.confidence, sighting.date, sighting.time)}>
|
||||
<ListItemText primary={`${sighting.desc}`} />
|
||||
</ListItem>
|
||||
);
|
||||
})
|
||||
}
|
||||
</List>
|
||||
</Fragment>
|
||||
</Grid>
|
||||
<Grid item xs={12} md={6} className='sighting-details'>
|
||||
{this.state.clicked === true && <SightingDetail detail={ this.state.selectedSighting }/>}
|
||||
{this.state.clicked === true && <SightingDetail detail={this.state.selectedSighting} />}
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Fragment>
|
|
@ -20,6 +20,13 @@ body {
|
|||
margin: 0 auto;
|
||||
}
|
||||
|
||||
#disqus_thread a,
|
||||
.comments .nav ul li a,
|
||||
.comments .nav ul li div a
|
||||
{
|
||||
color: #7986cb
|
||||
}
|
||||
|
||||
.sighting-list {
|
||||
height: calc(50vh - 64px);
|
||||
overflow-y: scroll;
|
|
@ -1,5 +0,0 @@
|
|||
import * as emailjs from 'emailjs-com'
|
||||
|
||||
emailjs.init("user_4d5R86dmu6vgeJP4euxSA");
|
||||
|
||||
export default emailjs;
|
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 72 KiB |
|
@ -1,7 +1,7 @@
|
|||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import './index.css';
|
||||
import App from './App';
|
||||
import './css/index.css';
|
||||
import App from './App.js';
|
||||
import registerServiceWorker from './registerServiceWorker';
|
||||
|
||||
ReactDOM.render(<App/>, document.getElementById('root'));
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React, { Component, Fragment } from 'react';
|
||||
import FlameLinkComponentCreations from '../components/FlameLinkComponentCreations';
|
||||
import flamelinkApp from '../flamelink.js';
|
||||
import FlameLinkComponentCreations from '../components/flamelink/FlameLinkComponentCreations';
|
||||
import flamelinkApp from '../utilities/flamelink.js';
|
||||
|
||||
class About extends Component {
|
||||
constructor() {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React, { Component } from 'react';
|
||||
import ContactForm from '../components/ContactForm.js'
|
||||
import ContactForm from '../components/forms/ContactForm.js'
|
||||
|
||||
class Contact extends Component {
|
||||
componentDidMount() {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import React, { Component } from 'react';
|
||||
import FlameLinkComponentCreations from '../components/FlameLinkComponentCreations';
|
||||
import FlameLinkCollectionGallery from '../components/FlameLinkCollectionGallery';
|
||||
import flamelinkApp from '../flamelink';
|
||||
import FlameLinkComponentCreations from '../components/flamelink/FlameLinkComponentCreations';
|
||||
import FlameLinkCollectionGallery from '../components/flamelink/FlameLinkCollectionGallery';
|
||||
import flamelinkApp from '../utilities/flamelink';
|
||||
import Grid from '@material-ui/core/Grid';
|
||||
|
||||
class Home extends Component {
|
||||
|
|