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 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';
|
||||
|
||||
|
@ -278,7 +278,7 @@ class ResponsiveDrawer extends React.Component {
|
|||
{this.state.key === 'Home' && <Home />}
|
||||
{this.state.key === 'Report' && <Report />}
|
||||
{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 === 'Contact' && <Contact />}
|
||||
{this.state.key === 'Easy-Quiz' && <Quiz difficulty='Easy' />}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React, { Component} from 'react';
|
||||
import flamelinkApp from '../flamelink.js';
|
||||
import flamelinkApp from '../../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 '../../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 '../../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 '../../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 '../../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 '../../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 '../../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 '../../firebase.js';
|
||||
import GoogleMap from './ReportMap';
|
||||
import Modal from '@material-ui/core/Modal';
|
||||
import Typography from '@material-ui/core/Typography';
|
||||
|
|
@ -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 '../../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>
|
||||
|
@ -74,8 +92,8 @@ class ViewSightings extends Component {
|
|||
{
|
||||
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 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>
|
||||
);
|
||||
})
|
||||
|
@ -84,7 +102,7 @@ class ViewSightings extends Component {
|
|||
</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>
|
|
@ -1,5 +1,5 @@
|
|||
import React, { Component, Fragment } from 'react';
|
||||
import FlameLinkComponentCreations from '../components/FlameLinkComponentCreations';
|
||||
import FlameLinkComponentCreations from '../components/flamelink/FlameLinkComponentCreations';
|
||||
import flamelinkApp from '../flamelink.js';
|
||||
|
||||
class About extends Component {
|
||||
|
|
|
@ -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,6 +1,6 @@
|
|||
import React, { Component } from 'react';
|
||||
import FlameLinkComponentCreations from '../components/FlameLinkComponentCreations';
|
||||
import FlameLinkCollectionGallery from '../components/FlameLinkCollectionGallery';
|
||||
import FlameLinkComponentCreations from '../components/flamelink/FlameLinkComponentCreations';
|
||||
import FlameLinkCollectionGallery from '../components/flamelink/FlameLinkCollectionGallery';
|
||||
import flamelinkApp from '../flamelink';
|
||||
import Grid from '@material-ui/core/Grid';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React, { Component, Fragment } from 'react';
|
||||
import FlameLinkComponentCreations from '../components/FlameLinkComponentCreations';
|
||||
import FlameLinkComponentCreations from '../components/flamelink/FlameLinkComponentCreations';
|
||||
import flamelinkApp from '../flamelink.js';
|
||||
|
||||
class Info extends Component {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React, { Component } from 'react';
|
||||
import ReportForm from '../components/ReportForm';
|
||||
import ReportForm from '../components/forms/ReportForm';
|
||||
|
||||
class Report extends Component {
|
||||
componentDidMount() {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React, { Component } from 'react';
|
||||
import ViewSightings from '../components/ViewSightings.js';
|
||||
import ViewSightings from '../components/list/ViewSightings.js';
|
||||
|
||||
class Sighting extends Component {
|
||||
componentDidMount() {
|
||||
|
@ -8,7 +8,7 @@ class Sighting extends Component {
|
|||
|
||||
render() {
|
||||
return (
|
||||
<ViewSightings/>
|
||||
<ViewSightings themeName={this.props.themeName}/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue