Fixed issue with sighting list, although I hate my solution.

This commit is contained in:
wildscotsmen 2018-12-11 23:54:52 -05:00
parent e9b5e1f9cd
commit 0e9a85e803
2 changed files with 133 additions and 151 deletions

View File

@ -226,17 +226,17 @@ class ResponsiveDrawer extends React.Component {
</ListItem>
<Collapse in={this.state.open} timeout="auto" unmountOnExit>
<List component="div" disablePadding>
<Link to={{pathname: '/quiz-easy', state: {difficulty: 'Easy'}}}>
<Link to={{ pathname: '/quiz-easy', state: { difficulty: 'Easy' } }}>
<ListItem button className={classes.nested}>
<ListItemText inset primary="Easy" />
</ListItem>
</Link>
<Link to={{pathname: '/quiz-intermediate', state: {difficulty: 'Intermediate'}}}>
<Link to={{ pathname: '/quiz-intermediate', state: { difficulty: 'Intermediate' } }}>
<ListItem button className={classes.nested}>
<ListItemText inset primary="Intermediate" />
</ListItem>
</Link>
<Link to={{pathname: '/quiz-advanced', state: {difficulty: 'Advanced'}}}>
<Link to={{ pathname: '/quiz-advanced', state: { difficulty: 'Advanced' } }}>
<ListItem button className={classes.nested}>
<ListItemText inset primary="Advanced" />
</ListItem>
@ -264,22 +264,22 @@ class ResponsiveDrawer extends React.Component {
</ListItem>
<Collapse in={this.state.open2} timeout="auto" unmountOnExit>
<List component="div" disablePadding>
<Link to={{pathname: 'galleries-martens-and-kits', state: {galleryName: 'martensAndKits'}}}>
<Link to={{ pathname: 'galleries-martens-and-kits', state: { galleryName: 'martensAndKits' } }}>
<ListItem button className={classes.nested}>
<ListItemText inset primary="Martens and Kits" />
</ListItem>
</Link>
<Link to={{pathname: 'galleries-martens-at-night', state: {galleryName: 'martensAtNight'}}}>
<Link to={{ pathname: 'galleries-martens-at-night', state: { galleryName: 'martensAtNight' } }}>
<ListItem button className={classes.nested}>
<ListItemText inset primary="Martens at Night" />
</ListItem>
</Link>
<Link to={{pathname: 'galleries-martens-by-day', state: {galleryName: 'martensBeingMartens'}}}>
<Link to={{ pathname: 'galleries-martens-by-day', state: { galleryName: 'martensBeingMartens' } }}>
<ListItem button className={classes.nested}>
<ListItemText inset primary="Martens by Day" />
</ListItem>
</Link>
<Link to={{pathname: 'galleries-species-similar-to-martens', state: {galleryName: 'similarSpecies'}}}>
<Link to={{ pathname: 'galleries-species-similar-to-martens', state: { galleryName: 'similarSpecies' } }}>
<ListItem button className={classes.nested}>
<ListItemText inset primary="Species Similar to Martens" />
</ListItem>
@ -353,13 +353,13 @@ class ResponsiveDrawer extends React.Component {
<Route path="/" component={Home} exact={true} />
<Route path="/report" component={Report} />
<Route path="/view-map" component={ViewMap} />
<Route path="/sighting-list" component={SightingList} />
<Route path="/sighting-list" component={SightingList} key={this.state.themeName} />
<Route path="/about" component={About} />
<Route path="/contact" component={Contact} />
<Route path="/quiz-easy" component={Quiz} key={"Easy"}/>
<Route path="/quiz-intermediate" component={Quiz} key={"Intermediate"}/>
<Route path="/quiz-easy" component={Quiz} key={"Easy"} />
<Route path="/quiz-intermediate" component={Quiz} key={"Intermediate"} />
<Route path="/quiz-advanced" component={Quiz} key={"Advanced"} />
<Route path="/galleries-martens-and-kits" component={FlameLinkCollectionGallery} key={"martensAndKits"}/>
<Route path="/galleries-martens-and-kits" component={FlameLinkCollectionGallery} key={"martensAndKits"} />
<Route path="/galleries-martens-at-night" component={FlameLinkCollectionGallery} key={"martensAtNight"} />
<Route path="/galleries-martens-by-day" component={FlameLinkCollectionGallery} key={"martensByDay"} />
<Route path="/galleries-species-similar-to-martens" component={FlameLinkCollectionGallery} key={"similarSpecies"} />

View File

@ -64,24 +64,6 @@ 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>