commit
72bc8d6552
|
@ -224,17 +224,17 @@ class ResponsiveDrawer extends React.Component {
|
|||
</ListItem>
|
||||
<Collapse in={this.state.open} timeout="auto" unmountOnExit>
|
||||
<List component="div" disablePadding>
|
||||
<Link to='/quiz-easy'>
|
||||
<Link to={{pathname: '/quiz-easy', state: {difficulty: 'Easy'}}}>
|
||||
<ListItem button className={classes.nested}>
|
||||
<ListItemText inset primary="Easy" />
|
||||
</ListItem>
|
||||
</Link>
|
||||
<Link to='/quiz-intermediate'>
|
||||
<Link to={{pathname: '/quiz-intermediate', state: {difficulty: 'Intermediate'}}}>
|
||||
<ListItem button className={classes.nested}>
|
||||
<ListItemText inset primary="Intermediate" />
|
||||
</ListItem>
|
||||
</Link>
|
||||
<Link to='/quiz-advanced'>
|
||||
<Link to={{pathname: '/quiz-advanced', state: {difficulty: 'Advanced'}}}>
|
||||
<ListItem button className={classes.nested}>
|
||||
<ListItemText inset primary="Advanced" />
|
||||
</ListItem>
|
||||
|
@ -262,22 +262,22 @@ class ResponsiveDrawer extends React.Component {
|
|||
</ListItem>
|
||||
<Collapse in={this.state.open2} timeout="auto" unmountOnExit>
|
||||
<List component="div" disablePadding>
|
||||
<Link to='galleries-martens-and-kits'>
|
||||
<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='galleries-martens-at-night'>
|
||||
<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='galleries-martens-by-day'>
|
||||
<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='galleries-species-similar-to-martens'>
|
||||
<Link to={{pathname: 'galleries-species-similar-to-martens', state: {galleryName: 'similarSpecies'}}}>
|
||||
<ListItem button className={classes.nested}>
|
||||
<ListItemText inset primary="Species Similar to Martens" />
|
||||
</ListItem>
|
||||
|
@ -348,19 +348,19 @@ class ResponsiveDrawer extends React.Component {
|
|||
<main className={classes.content}>
|
||||
<div className={classes.toolbar} />
|
||||
<Switch>
|
||||
<Route path="/" exact={true} component={Home} />
|
||||
<Route path="/report" component={ () => { return <Report/> }} />
|
||||
<Route path="/view-map" component={ () => { return <ViewMap/> }} />
|
||||
<Route path="/sighting-list" component={ () => { return <SightingList themeName={this.state.themeName}/> }} />
|
||||
<Route path="/about" component={ () => { return <About/> }} />
|
||||
<Route path="/contact" component={ () => { return <Contact/> }} />
|
||||
<Route path="/quiz-easy" component={ () => { return <Quiz difficulty='Easy'/> }} />
|
||||
<Route path="/quiz-intermediate" component={ () => { return <Quiz difficulty='Intermediate'/> }} />
|
||||
<Route path="/quiz-advanced" component={ () => { return <Quiz difficulty='Advanced'/> }} />
|
||||
<Route path="/galleries-martens-and-kits" component={ () => { return <FlameLinkCollectionGallery galleryName={'martensAndKits'}/> }} />
|
||||
<Route path="/galleries-martens-at-night" component={ () => { return <FlameLinkCollectionGallery galleryName={'martensAtNight'}/> }} />
|
||||
<Route path="/galleries-martens-by-day" component={ () => { return <FlameLinkCollectionGallery galleryName={'martensBeingMartens'}/> }} />
|
||||
<Route path="/galleries-species-similar-to-martens" component={ () => { return <FlameLinkCollectionGallery galleryName={'similarSpecies'}/> }} />
|
||||
<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="/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-advanced" component={Quiz} key={"Advanced"} />
|
||||
<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"} />
|
||||
</Switch>
|
||||
</main>
|
||||
</div>
|
||||
|
|
|
@ -297,8 +297,8 @@ export class MapContainer extends Component {
|
|||
description={<Fragment><b>Description:</b> {sighting.desc}</Fragment>}
|
||||
icon={{
|
||||
url: pinIcon,
|
||||
anchor: new google.maps.Point(48,48),
|
||||
scaledSize: new google.maps.Size(48,48)
|
||||
anchor: new google.maps.Point(32,32),
|
||||
scaledSize: new google.maps.Size(32,32)
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
|
|
@ -41,51 +41,52 @@ const styles = theme => ({
|
|||
});
|
||||
|
||||
class FlameLinkCollectionGallery extends Component {
|
||||
getPageTitle = galleryName => {
|
||||
switch (galleryName) {
|
||||
case 'martensAndKits':
|
||||
document.title = 'Marten Tracker | Martens and Kits';
|
||||
break;
|
||||
case 'martensAtNight':
|
||||
document.title = 'Marten Tracker | Martens at Night';
|
||||
break;
|
||||
case 'martensBeingMartens':
|
||||
document.title = 'Marten Tracker | Martens Being Martens';
|
||||
break;
|
||||
default:
|
||||
document.title = 'Marten Tracker | Galleries';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
var galleryName, showTitle;
|
||||
|
||||
if (this.props.galleryName !== undefined) {
|
||||
galleryName = this.props.galleryName;
|
||||
} else {
|
||||
galleryName = this.props.location.state.galleryName;
|
||||
}
|
||||
|
||||
if (this.props.showTitle !== undefined) {
|
||||
showTitle = this.props.showTitle;
|
||||
} else {
|
||||
showTitle = this.props.location.state.showTitle;
|
||||
}
|
||||
|
||||
this.state = {
|
||||
galleryName: galleryName,
|
||||
showTitle: showTitle,
|
||||
schemaDetails: '',
|
||||
schemaContent: '',
|
||||
schemaDescription: '',
|
||||
};
|
||||
|
||||
flamelinkApp.schemas.getFields(this.props.galleryName, { fields: ['title', 'key', 'type', 'gridColumns', 'description', 'options'] })
|
||||
flamelinkApp.schemas.getFields(this.state.galleryName, { fields: ['title', 'key', 'type', 'gridColumns', 'description', 'options'] })
|
||||
.then(result => this.setState({
|
||||
schemaDetails: result
|
||||
}))
|
||||
|
||||
flamelinkApp.content.get(this.props.galleryName)
|
||||
flamelinkApp.content.get(this.state.galleryName)
|
||||
.then(result => this.setState({
|
||||
schemaContent: result
|
||||
}))
|
||||
|
||||
if (this.props.showTitle === false) {
|
||||
if (this.state.showTitle === false) {
|
||||
} else {
|
||||
flamelinkApp.schemas.get(this.props.galleryName)
|
||||
flamelinkApp.schemas.get(this.state.galleryName)
|
||||
.then(result => this.setState({
|
||||
schemaDescription: result.title
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
this.getPageTitle(this.props.galleryName);
|
||||
componentDidMount() {
|
||||
document.title = 'Marten Tracker | Galleries';
|
||||
}
|
||||
|
||||
getGalleryInfo(schemaDetails, schemaContent) {
|
||||
|
|
|
@ -130,7 +130,7 @@ class ContactForm extends React.Component {
|
|||
<Fragment>
|
||||
<Typography variant="headline" align="center">
|
||||
{<br/>}
|
||||
Send us an email!
|
||||
Feel free to contact us if you have any questions about American martens,{<br/>}encountered any difficulties with the website, or if you have any ideas for future marten research.
|
||||
|
||||
<form className={classes.container} autoComplete="off" onSubmit={this.handleSubmit}>
|
||||
<Grid container className="contact-form">
|
||||
|
|
|
@ -3,13 +3,14 @@ import QuizGame from '../components/QuizGame';
|
|||
|
||||
|
||||
class QuizPage extends Component {
|
||||
componentDidMount() {
|
||||
componentWillMount() {
|
||||
document.title = 'Marten Tracker | Quiz';
|
||||
this.setState({difficulty: this.props.location.state.difficulty});
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<QuizGame difficulty={this.props.difficulty}/>
|
||||
<QuizGame difficulty={this.state.difficulty}/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue