Fixed minor bug with theme swap and restructured components folder.
This commit is contained in:
parent
c9a771d1bc
commit
d8119c8773
|
@ -32,7 +32,7 @@ import CssBaseline from '@material-ui/core/CssBaseline';
|
||||||
import ExpandLess from '@material-ui/icons/ExpandLess';
|
import ExpandLess from '@material-ui/icons/ExpandLess';
|
||||||
import ExpandMore from '@material-ui/icons/ExpandMore';
|
import ExpandMore from '@material-ui/icons/ExpandMore';
|
||||||
import Collapse from '@material-ui/core/Collapse';
|
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 { MuiThemeProvider, createMuiTheme } from '@material-ui/core/styles';
|
||||||
import Switch from '@material-ui/core/Switch';
|
import Switch from '@material-ui/core/Switch';
|
||||||
|
|
||||||
|
@ -278,7 +278,7 @@ class ResponsiveDrawer extends React.Component {
|
||||||
{this.state.key === 'Home' && <Home />}
|
{this.state.key === 'Home' && <Home />}
|
||||||
{this.state.key === 'Report' && <Report />}
|
{this.state.key === 'Report' && <Report />}
|
||||||
{this.state.key === 'Map' && <ViewMap />}
|
{this.state.key === 'Map' && <ViewMap />}
|
||||||
{this.state.key === 'List' && <SightingList key={this.state.themeName} />}
|
{this.state.key === 'List' && <SightingList themeName={this.state.themeName} />}
|
||||||
{this.state.key === 'About' && <About />}
|
{this.state.key === 'About' && <About />}
|
||||||
{this.state.key === 'Contact' && <Contact />}
|
{this.state.key === 'Contact' && <Contact />}
|
||||||
{this.state.key === 'Easy-Quiz' && <Quiz difficulty='Easy' />}
|
{this.state.key === 'Easy-Quiz' && <Quiz difficulty='Easy' />}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React, { Component} from 'react';
|
import React, { Component} from 'react';
|
||||||
import flamelinkApp from '../flamelink.js';
|
import flamelinkApp from '../../flamelink.js';
|
||||||
import FlameLinkCollectionComponentCreations from './FlameLinkCollectionComponentCreations';
|
import FlameLinkCollectionComponentCreations from './FlameLinkCollectionComponentCreations';
|
||||||
|
|
||||||
class FlameLinkCollection extends Component {
|
class FlameLinkCollection extends Component {
|
|
@ -3,10 +3,10 @@ import Typography from '@material-ui/core/Typography';
|
||||||
import Grid from '@material-ui/core/Grid';
|
import Grid from '@material-ui/core/Grid';
|
||||||
import { withStyles } from '@material-ui/core/styles';
|
import { withStyles } from '@material-ui/core/styles';
|
||||||
import RenderGallery from './RenderGallery';
|
import RenderGallery from './RenderGallery';
|
||||||
import flamelinkApp from '../flamelink.js';
|
import flamelinkApp from '../../flamelink.js';
|
||||||
import FlameLinkCollectionGalleryContent from './FlameLinkCollectionGalleryContent';
|
import FlameLinkCollectionGalleryContent from './FlameLinkCollectionGalleryContent';
|
||||||
import "react-image-gallery/styles/css/image-gallery.css";
|
import "react-image-gallery/styles/css/image-gallery.css";
|
||||||
import '../css/FlameLink.css';
|
import '../../css/FlameLink.css';
|
||||||
|
|
||||||
const styles = theme => ({
|
const styles = theme => ({
|
||||||
flamelinkItem: {
|
flamelinkItem: {
|
|
@ -1,6 +1,6 @@
|
||||||
import { Component } from 'react';
|
import { Component } from 'react';
|
||||||
import flamelinkApp from '../flamelink.js';
|
import flamelinkApp from '../../flamelink.js';
|
||||||
import '../css/FlameLink.css';
|
import '../../css/FlameLink.css';
|
||||||
|
|
||||||
class FlameLinkCollectionGalleryContent extends Component {
|
class FlameLinkCollectionGalleryContent extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
|
@ -2,7 +2,7 @@ import React, { Component} from 'react';
|
||||||
import Grid from '@material-ui/core/Grid';
|
import Grid from '@material-ui/core/Grid';
|
||||||
import Typography from '@material-ui/core/Typography';
|
import Typography from '@material-ui/core/Typography';
|
||||||
import { withStyles } from '@material-ui/core/styles';
|
import { withStyles } from '@material-ui/core/styles';
|
||||||
import flamelinkApp from '../flamelink.js';
|
import flamelinkApp from '../../flamelink.js';
|
||||||
import FlameLinkImage from './FlameLinkImage';
|
import FlameLinkImage from './FlameLinkImage';
|
||||||
import FlameLinkFieldSet from './FlameLinkFieldSet';
|
import FlameLinkFieldSet from './FlameLinkFieldSet';
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import Typography from '@material-ui/core/Typography';
|
import Typography from '@material-ui/core/Typography';
|
||||||
import flamelinkApp from '../flamelink.js';
|
import flamelinkApp from '../../flamelink.js';
|
||||||
import '../css/FlameLink.css';
|
import '../../css/FlameLink.css';
|
||||||
|
|
||||||
class FlameLinkImage extends Component {
|
class FlameLinkImage extends Component {
|
||||||
constructor() {
|
constructor() {
|
|
@ -2,7 +2,7 @@ import React, { Component} from 'react';
|
||||||
import Grid from '@material-ui/core/Grid';
|
import Grid from '@material-ui/core/Grid';
|
||||||
import Typography from '@material-ui/core/Typography';
|
import Typography from '@material-ui/core/Typography';
|
||||||
import { withStyles } from '@material-ui/core/styles';
|
import { withStyles } from '@material-ui/core/styles';
|
||||||
import flamelinkApp from '../flamelink.js';
|
import flamelinkApp from '../../flamelink.js';
|
||||||
import FlameLinkImage from './FlameLinkImage';
|
import FlameLinkImage from './FlameLinkImage';
|
||||||
import FlameLinkFieldSet from './FlameLinkFieldSet';
|
import FlameLinkFieldSet from './FlameLinkFieldSet';
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import ImageGallery from 'react-image-gallery';
|
import ImageGallery from 'react-image-gallery';
|
||||||
import "react-image-gallery/styles/css/image-gallery.css";
|
import "react-image-gallery/styles/css/image-gallery.css";
|
||||||
import '../css/FlameLink.css';
|
import '../../css/FlameLink.css';
|
||||||
|
|
||||||
class RenderGallery extends Component {
|
class RenderGallery extends Component {
|
||||||
constructor() {
|
constructor() {
|
|
@ -1,7 +1,7 @@
|
||||||
import React, { Fragment } from 'react';
|
import React, { Fragment } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import Grid from '@material-ui/core/Grid';
|
import Grid from '@material-ui/core/Grid';
|
||||||
import emailjs from '../emailjs.js'
|
import emailjs from '../../emailjs.js'
|
||||||
import { withStyles } from '@material-ui/core/styles';
|
import { withStyles } from '@material-ui/core/styles';
|
||||||
import TextField from '@material-ui/core/TextField';
|
import TextField from '@material-ui/core/TextField';
|
||||||
import CheckCircleIcon from '@material-ui/icons/CheckCircle';
|
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 IconButton from '@material-ui/core/IconButton';
|
||||||
import CloseIcon from '@material-ui/icons/Close';
|
import CloseIcon from '@material-ui/icons/Close';
|
||||||
import Button from '@material-ui/core/Button';
|
import Button from '@material-ui/core/Button';
|
||||||
import firebase from '../firebase.js';
|
import firebase from '../../firebase.js';
|
||||||
import GoogleMap from '../components/ReportMap';
|
import GoogleMap from './ReportMap';
|
||||||
import Modal from '@material-ui/core/Modal';
|
import Modal from '@material-ui/core/Modal';
|
||||||
import Typography from '@material-ui/core/Typography';
|
import Typography from '@material-ui/core/Typography';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { Component, Fragment } from 'react';
|
import React, { Component, Fragment } from 'react';
|
||||||
import Grid from '@material-ui/core/Grid';
|
import Grid from '@material-ui/core/Grid';
|
||||||
import firebase from '../firebase.js';
|
import firebase from '../../firebase.js';
|
||||||
import List from '@material-ui/core/List';
|
import List from '@material-ui/core/List';
|
||||||
import ListItem from '@material-ui/core/ListItem';
|
import ListItem from '@material-ui/core/ListItem';
|
||||||
import ListItemText from '@material-ui/core/ListItemText';
|
import ListItemText from '@material-ui/core/ListItemText';
|
||||||
|
@ -64,6 +64,24 @@ class ViewSightings extends Component {
|
||||||
clicked: false
|
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() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
|
@ -71,20 +89,20 @@ class ViewSightings extends Component {
|
||||||
<Grid item xs={12} md={6} className='sighting-list'>
|
<Grid item xs={12} md={6} className='sighting-list'>
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<List>
|
<List>
|
||||||
{
|
{
|
||||||
this.state.sightings.map((sighting) => {
|
this.state.sightings.map((sighting) => {
|
||||||
return (
|
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)}>
|
<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}`}/>
|
<ListItemText primary={`${sighting.desc}`} />
|
||||||
</ListItem>
|
</ListItem>
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</List>
|
</List>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={12} md={6} className='sighting-details'>
|
<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>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Fragment>
|
</Fragment>
|
|
@ -1,5 +1,5 @@
|
||||||
import React, { Component, Fragment } from 'react';
|
import React, { Component, Fragment } from 'react';
|
||||||
import FlameLinkComponentCreations from '../components/FlameLinkComponentCreations';
|
import FlameLinkComponentCreations from '../components/flamelink/FlameLinkComponentCreations';
|
||||||
import flamelinkApp from '../flamelink.js';
|
import flamelinkApp from '../flamelink.js';
|
||||||
|
|
||||||
class About extends Component {
|
class About extends Component {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import ContactForm from '../components/ContactForm.js'
|
import ContactForm from '../components/forms/ContactForm.js'
|
||||||
|
|
||||||
class Contact extends Component {
|
class Contact extends Component {
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import FlameLinkComponentCreations from '../components/FlameLinkComponentCreations';
|
import FlameLinkComponentCreations from '../components/flamelink/FlameLinkComponentCreations';
|
||||||
import FlameLinkCollectionGallery from '../components/FlameLinkCollectionGallery';
|
import FlameLinkCollectionGallery from '../components/flamelink/FlameLinkCollectionGallery';
|
||||||
import flamelinkApp from '../flamelink';
|
import flamelinkApp from '../flamelink';
|
||||||
import Grid from '@material-ui/core/Grid';
|
import Grid from '@material-ui/core/Grid';
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React, { Component, Fragment } from 'react';
|
import React, { Component, Fragment } from 'react';
|
||||||
import FlameLinkComponentCreations from '../components/FlameLinkComponentCreations';
|
import FlameLinkComponentCreations from '../components/flamelink/FlameLinkComponentCreations';
|
||||||
import flamelinkApp from '../flamelink.js';
|
import flamelinkApp from '../flamelink.js';
|
||||||
|
|
||||||
class Info extends Component {
|
class Info extends Component {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import ReportForm from '../components/ReportForm';
|
import ReportForm from '../components/forms/ReportForm';
|
||||||
|
|
||||||
class Report extends Component {
|
class Report extends Component {
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import ViewSightings from '../components/ViewSightings.js';
|
import ViewSightings from '../components/list/ViewSightings.js';
|
||||||
|
|
||||||
class Sighting extends Component {
|
class Sighting extends Component {
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
@ -8,7 +8,7 @@ class Sighting extends Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<ViewSightings/>
|
<ViewSightings themeName={this.props.themeName}/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue