Merge branch 'master' of https://github.com/alDuncanson/marten-application
|
@ -12513,9 +12513,9 @@
|
|||
}
|
||||
},
|
||||
"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==",
|
||||
"version": "3.0.8",
|
||||
"resolved": "https://registry.npmjs.org/react-cookie/-/react-cookie-3.0.8.tgz",
|
||||
"integrity": "sha512-Gdop2Cf2pBFA0r4L9l5DRghKsPVMNKRM3x2aeyJ4JSaENpWWPP4v9LJvvtxXs3AboOGCuMj19oUw04Z9cVQQTg==",
|
||||
"requires": {
|
||||
"@types/hoist-non-react-statics": "^3.0.1",
|
||||
"hoist-non-react-statics": "^3.0.0",
|
||||
|
@ -12523,9 +12523,9 @@
|
|||
},
|
||||
"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==",
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.2.1.tgz",
|
||||
"integrity": "sha512-TFsu3TV3YLY+zFTZDrN8L2DTFanObwmBLpWvJs1qfUuEQ5bTAdFcwfx2T/bsCXfM9QHSLvjfP+nihEl0yvozxw==",
|
||||
"requires": {
|
||||
"react-is": "^16.3.2"
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
"material-ui-icons": "^1.0.0-beta.36",
|
||||
"moment": "^2.22.2",
|
||||
"react": "^16.5.1",
|
||||
"react-cookie": "^3.0.7",
|
||||
"react-cookie": "^3.0.8",
|
||||
"react-dom": "^16.5.1",
|
||||
"react-image-gallery": "^0.8.12",
|
||||
"react-quiz-component": "0.2.0",
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
You need to enable JavaScript to run this app.
|
||||
</noscript>
|
||||
<div id="root"></div>
|
||||
<!-- Hotjar Tracking Code for https://marten-application.netlify.com/ -->
|
||||
<!-- Hotjar Tracking Code for https://marten-tracker.netlify.com/ -->
|
||||
<script>
|
||||
(function(h,o,t,j,a,r){
|
||||
|
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 73 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 71 KiB |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 63 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 96 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 91 KiB |
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 366 KiB |
|
@ -34,8 +34,14 @@ import ExpandMore from '@material-ui/icons/ExpandMore';
|
|||
import Collapse from '@material-ui/core/Collapse';
|
||||
import FlameLinkCollectionGallery from '../components/flamelink/FlameLinkCollectionGallery';
|
||||
import { MuiThemeProvider, createMuiTheme } from '@material-ui/core/styles';
|
||||
import Switch from '@material-ui/core/Switch';
|
||||
import ThemeSwitch from '@material-ui/core/Switch';
|
||||
import { withCookies, Cookies } from 'react-cookie';
|
||||
import {
|
||||
BrowserRouter as Router,
|
||||
Route,
|
||||
Link,
|
||||
Switch
|
||||
} from 'react-router-dom';
|
||||
|
||||
const drawerWidth = 240;
|
||||
|
||||
|
@ -121,7 +127,6 @@ class ResponsiveDrawer extends React.Component {
|
|||
|
||||
this.setState({
|
||||
mobileOpen: false,
|
||||
key: 'Home',
|
||||
open: false,
|
||||
open2: false,
|
||||
theme: newTheme,
|
||||
|
@ -142,17 +147,9 @@ class ResponsiveDrawer extends React.Component {
|
|||
this.setState(state => ({ open2: !state.open2, open: false }));
|
||||
}
|
||||
|
||||
nav = (text) => {
|
||||
this.setState({
|
||||
key: text
|
||||
});
|
||||
}
|
||||
|
||||
handleChange = name => event => {
|
||||
const { cookies } = this.props;
|
||||
|
||||
this.setState({ [name]: event.target.checked });
|
||||
|
||||
var newTheme, newName;
|
||||
|
||||
if (this.state.themeName === 'light') {
|
||||
|
@ -189,28 +186,35 @@ class ResponsiveDrawer extends React.Component {
|
|||
|
||||
render() {
|
||||
const { classes } = this.props;
|
||||
|
||||
const drawer = (
|
||||
<Typography component="div">
|
||||
<div className={classes.toolbar} />
|
||||
<Divider />
|
||||
<List>
|
||||
<ListItem button key='Home' onClick={() => this.nav('Home')}>
|
||||
<Link to='/'>
|
||||
<ListItem button>
|
||||
<ListItemIcon><HomeIcon /></ListItemIcon>
|
||||
<ListItemText primary='Home' />
|
||||
</ListItem>
|
||||
<ListItem button key='Report' onClick={() => this.nav('Report')}>
|
||||
</Link>
|
||||
<Link to='/report'>
|
||||
<ListItem button>
|
||||
<ListItemIcon><AssignmentIcon /></ListItemIcon>
|
||||
<ListItemText primary='Report' />
|
||||
</ListItem>
|
||||
<ListItem button key='Map' onClick={() => this.nav('Map')}>
|
||||
</Link>
|
||||
<Link to='/view-map'>
|
||||
<ListItem button>
|
||||
<ListItemIcon><MapIcon /></ListItemIcon>
|
||||
<ListItemText primary='Map' />
|
||||
</ListItem>
|
||||
<ListItem button key='List' onClick={() => this.nav('List')}>
|
||||
</Link>
|
||||
<Link to='/sighting-list'>
|
||||
<ListItem button>
|
||||
<ListItemIcon><ListIcon /></ListItemIcon>
|
||||
<ListItemText primary='List' />
|
||||
</ListItem>
|
||||
</Link>
|
||||
<ListItem button onClick={this.handleClick}>
|
||||
<ListItemIcon>
|
||||
<SlideshowIcon />
|
||||
|
@ -220,25 +224,35 @@ class ResponsiveDrawer extends React.Component {
|
|||
</ListItem>
|
||||
<Collapse in={this.state.open} timeout="auto" unmountOnExit>
|
||||
<List component="div" disablePadding>
|
||||
<ListItem button className={classes.nested} onClick={() => this.nav('Easy-Quiz')}>
|
||||
<Link to='/quiz-easy'>
|
||||
<ListItem button className={classes.nested}>
|
||||
<ListItemText inset primary="Easy" />
|
||||
</ListItem>
|
||||
<ListItem button className={classes.nested} onClick={() => this.nav('Intermediate-Quiz')}>
|
||||
</Link>
|
||||
<Link to='/quiz-intermediate'>
|
||||
<ListItem button className={classes.nested}>
|
||||
<ListItemText inset primary="Intermediate" />
|
||||
</ListItem>
|
||||
<ListItem button className={classes.nested} onClick={() => this.nav('Advanced-Quiz')}>
|
||||
</Link>
|
||||
<Link to='/quiz-advanced'>
|
||||
<ListItem button className={classes.nested}>
|
||||
<ListItemText inset primary="Advanced" />
|
||||
</ListItem>
|
||||
</Link>
|
||||
</List>
|
||||
</Collapse>
|
||||
<ListItem button key='Contact' onClick={() => this.nav('Contact')}>
|
||||
<Link to='/contact'>
|
||||
<ListItem button>
|
||||
<ListItemIcon><EmailIcon /></ListItemIcon>
|
||||
<ListItemText primary='Contact' />
|
||||
</ListItem>
|
||||
<ListItem button key='About' onClick={() => this.nav('About')}>
|
||||
</Link>
|
||||
<Link to='/about'>
|
||||
<ListItem button>
|
||||
<ListItemIcon><InfoIcon /></ListItemIcon>
|
||||
<ListItemText primary='About' />
|
||||
</ListItem>
|
||||
</Link>
|
||||
<ListItem button onClick={this.handleClick2}>
|
||||
<ListItemIcon>
|
||||
<PhotoLibraryIcon />
|
||||
|
@ -248,18 +262,26 @@ class ResponsiveDrawer extends React.Component {
|
|||
</ListItem>
|
||||
<Collapse in={this.state.open2} timeout="auto" unmountOnExit>
|
||||
<List component="div" disablePadding>
|
||||
<ListItem button className={classes.nested} onClick={() => this.nav('Gallery1')}>
|
||||
<Link to='galleries-martens-and-kits'>
|
||||
<ListItem button className={classes.nested}>
|
||||
<ListItemText inset primary="Martens and Kits" />
|
||||
</ListItem>
|
||||
<ListItem button className={classes.nested} onClick={() => this.nav('Gallery2')}>
|
||||
</Link>
|
||||
<Link to='galleries-martens-at-night'>
|
||||
<ListItem button className={classes.nested}>
|
||||
<ListItemText inset primary="Martens at Night" />
|
||||
</ListItem>
|
||||
<ListItem button className={classes.nested} onClick={() => this.nav('Gallery3')}>
|
||||
</Link>
|
||||
<Link to='galleries-martens-by-day'>
|
||||
<ListItem button className={classes.nested}>
|
||||
<ListItemText inset primary="Martens Being Martens" />
|
||||
</ListItem>
|
||||
<ListItem button className={classes.nested} onClick={() => this.nav('Gallery4')}>
|
||||
</Link>
|
||||
<Link to='galleries-species-similar-to-martens'>
|
||||
<ListItem button className={classes.nested}>
|
||||
<ListItemText inset primary="Species Similar to Martens" />
|
||||
</ListItem>
|
||||
</Link>
|
||||
</List>
|
||||
</Collapse>
|
||||
</List>
|
||||
|
@ -268,6 +290,7 @@ class ResponsiveDrawer extends React.Component {
|
|||
);
|
||||
|
||||
return (
|
||||
<Router>
|
||||
<MuiThemeProvider theme={this.state.theme}>
|
||||
<div className={classes.root}>
|
||||
<CssBaseline />
|
||||
|
@ -284,7 +307,7 @@ class ResponsiveDrawer extends React.Component {
|
|||
<Typography variant="title" color="inherit" noWrap>
|
||||
Marten Tracker
|
||||
</Typography>
|
||||
<Switch
|
||||
<ThemeSwitch
|
||||
checked={this.state.themeChecked}
|
||||
onChange={this.handleChange('themeChecked')}
|
||||
value="themeChecked"
|
||||
|
@ -324,22 +347,25 @@ class ResponsiveDrawer extends React.Component {
|
|||
</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'} />}
|
||||
<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-similar-species" component={ () => { return <FlameLinkCollectionGallery galleryName={'similarSpecies'}/> }} />
|
||||
</Switch>
|
||||
</main>
|
||||
</div>
|
||||
</MuiThemeProvider>
|
||||
</Router>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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(32,32),
|
||||
scaledSize: new google.maps.Size(32,32)
|
||||
anchor: new google.maps.Point(48,48),
|
||||
scaledSize: new google.maps.Size(48,48)
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
|
|
@ -1,55 +1,61 @@
|
|||
import React, { Component} from 'react';
|
||||
import React, { Component } from 'react';
|
||||
import flamelinkApp from '../../utilities/flamelink.js';
|
||||
import Grid from '@material-ui/core/Grid';
|
||||
import FlameLinkCollectionComponentCreations from './FlameLinkCollectionComponentCreations';
|
||||
|
||||
class FlameLinkCollection extends Component {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
schemaContent: '',
|
||||
}
|
||||
|
||||
flamelinkApp.content.get(global.schemaName)
|
||||
flamelinkApp.content.get(this.props.schemaName)
|
||||
.then(result => this.setState({
|
||||
schemaContent: result
|
||||
}))
|
||||
}
|
||||
|
||||
getCollectionContent(schemaData){
|
||||
getCollectionContent(schemaData) {
|
||||
var arr2 = [];
|
||||
var collectionInfo = [schemaData, this.state.schemaContent];
|
||||
for (var val in this.state.schemaContent){
|
||||
for (var val in this.state.schemaContent) {
|
||||
if ( this.state.schemaContent[val].hasOwnProperty('order') ) {
|
||||
arr2[this.state.schemaContent[val]['order']] = val;
|
||||
}
|
||||
else{
|
||||
arr2.push(val);
|
||||
}
|
||||
}
|
||||
return arr2.map(this.getCollectionComponentInfo, collectionInfo);
|
||||
}
|
||||
|
||||
getCollectionComponentInfo(num){
|
||||
getCollectionComponentInfo(num) {
|
||||
var arr3 = [];
|
||||
for (var val in this[0]){
|
||||
for (var val in this[0]) {
|
||||
arr3.push(val);
|
||||
}
|
||||
|
||||
return <FlameLinkCollectionComponentCreations schemaData={this[0]} schemaContent={this[1][num]} arr={arr3} key={num} />
|
||||
}
|
||||
|
||||
countProperties(obj) {
|
||||
var count = 0;
|
||||
|
||||
for(var prop in obj) {
|
||||
if(obj.hasOwnProperty(prop))
|
||||
for (var prop in obj) {
|
||||
if (obj.hasOwnProperty(prop))
|
||||
++count;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
return(
|
||||
<div>
|
||||
return (
|
||||
<Grid container>
|
||||
{this.getCollectionContent(this.props.schemaData)}
|
||||
</div>
|
||||
</Grid>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,25 +1,48 @@
|
|||
import React, { Component} from 'react';
|
||||
import React, { Component } from 'react';
|
||||
import Grid from '@material-ui/core/Grid';
|
||||
import FlameLinkCollectionStructure from './FlameLinkCollectionStructure';
|
||||
import PropTypes from 'prop-types';
|
||||
import { withStyles } from '@material-ui/core/styles';
|
||||
import Paper from '@material-ui/core/Paper';
|
||||
|
||||
const styles = theme => ({
|
||||
root: {
|
||||
...theme.mixins.gutters(),
|
||||
margin: theme.spacing.unit * 2,
|
||||
paddingTop: theme.spacing.unit * 2,
|
||||
paddingBottom: theme.spacing.unit * 2,
|
||||
width: '100%'
|
||||
},
|
||||
});
|
||||
|
||||
class FlameLinkCollectionComponentCreations extends Component {
|
||||
|
||||
createCollectionEntries(schemaData, schemaContent, arr){
|
||||
createCollectionEntries(schemaData, schemaContent, arr) {
|
||||
var collectionInfo = [schemaData, schemaContent];
|
||||
return arr.map(this.createCollectionComponents, collectionInfo);
|
||||
}
|
||||
|
||||
createCollectionComponents(num){
|
||||
return <FlameLinkCollectionStructure schemaData={this[0]} schemaContent={this[1]} field={this[0][num]} type={this[0][num].type} key={this[0][num].key} />
|
||||
createCollectionComponents(num) {
|
||||
return (
|
||||
<FlameLinkCollectionStructure schemaData={this[0]} schemaContent={this[1]} field={this[0][num]} type={this[0][num].type} key={this[0][num].key} />
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
return(
|
||||
const { classes } = this.props;
|
||||
|
||||
return (
|
||||
<Paper className={classes.root} elevation={4}>
|
||||
<Grid container>
|
||||
{this.createCollectionEntries(this.props.schemaData, this.props.schemaContent, this.props.arr)}
|
||||
</Grid>
|
||||
</Paper>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default FlameLinkCollectionComponentCreations;
|
||||
FlameLinkCollectionComponentCreations.propTypes = {
|
||||
classes: PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
export default withStyles(styles)(FlameLinkCollectionComponentCreations);
|
|
@ -1,4 +1,4 @@
|
|||
import React, { Component} from 'react';
|
||||
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';
|
||||
|
@ -12,69 +12,67 @@ const styles = theme => ({
|
|||
paddingLeft: 20,
|
||||
paddingTop: 20,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
class FlameLinkCollectionStructure extends Component {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
global.mediaID = '';
|
||||
|
||||
this.state = {
|
||||
state = {
|
||||
schemaContent: '',
|
||||
}
|
||||
|
||||
flamelinkApp.content.get(global.schemaName)
|
||||
componentDidMount() {
|
||||
global.mediaID = '';
|
||||
|
||||
flamelinkApp.content.get(this.props.schemaName)
|
||||
.then(result => this.setState({
|
||||
schemaContent: result
|
||||
}))
|
||||
}
|
||||
|
||||
getContent(content, field, key, type, description){
|
||||
if (type === 'text'){
|
||||
if(description === 'h1'){
|
||||
getContent(content, field, key, type, description) {
|
||||
if (type === 'text') {
|
||||
if (description === 'h1') {
|
||||
return (
|
||||
<Typography variant='display4' id={key}>
|
||||
{content[key]}
|
||||
</Typography>
|
||||
)
|
||||
}
|
||||
if(description === 'h2'){
|
||||
if (description === 'h2') {
|
||||
return (
|
||||
<Typography variant='display3' id={key}>
|
||||
{content[key]}
|
||||
</Typography>
|
||||
)
|
||||
}
|
||||
if(description === 'h3'){
|
||||
if (description === 'h3') {
|
||||
return (
|
||||
<Typography variant='display2' id={key}>
|
||||
{content[key]}
|
||||
</Typography>
|
||||
)
|
||||
}
|
||||
if(description === 'h4'){
|
||||
if (description === 'h4') {
|
||||
return (
|
||||
<Typography variant='display1' id={key}>
|
||||
{content[key]}
|
||||
</Typography>
|
||||
)
|
||||
}
|
||||
if(description === 'h5'){
|
||||
if (description === 'h5') {
|
||||
return (
|
||||
<Typography variant='headline' id={key}>
|
||||
{content[key]}
|
||||
</Typography>
|
||||
)
|
||||
}
|
||||
if(description === 'h6'){
|
||||
if (description === 'h6') {
|
||||
return (
|
||||
<Typography variant='title' id={key}>
|
||||
{content[key]}
|
||||
</Typography>
|
||||
)
|
||||
}
|
||||
else{
|
||||
else {
|
||||
return (
|
||||
<Typography variant='body2' component="p" id={key}>
|
||||
{content[key]}
|
||||
|
@ -82,25 +80,25 @@ class FlameLinkCollectionStructure extends Component {
|
|||
)
|
||||
}
|
||||
}
|
||||
if(type === 'textarea'){
|
||||
if (type === 'textarea') {
|
||||
return (
|
||||
<Typography variant='body2' component="p" id={key}>
|
||||
{content[key]}
|
||||
</Typography>
|
||||
)
|
||||
}
|
||||
if (type === 'media'){
|
||||
for (var val in content[key]){
|
||||
if (type === 'media') {
|
||||
for (var val in content[key]) {
|
||||
global.mediaID = content[key][val];
|
||||
return <FlameLinkImage/>
|
||||
return <FlameLinkImage />
|
||||
}
|
||||
}
|
||||
if (type === 'fieldset'){
|
||||
if(content === ''){
|
||||
if (type === 'fieldset') {
|
||||
if (content === '') {
|
||||
return
|
||||
}
|
||||
else{
|
||||
return <FlameLinkFieldSet field={content[key]} field2={field.options}/>
|
||||
else {
|
||||
return <FlameLinkFieldSet field={content[key]} field2={field.options} />
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -112,7 +110,7 @@ class FlameLinkCollectionStructure extends Component {
|
|||
const md = this.props.field.gridColumns.md;
|
||||
const sm = this.props.field.gridColumns.sm;
|
||||
const xs = this.props.field.gridColumns.xs;
|
||||
return(
|
||||
return (
|
||||
<Grid item lg={lg} md={md} sm={sm} xs={xs} className={classes.flamelinkItem}>
|
||||
{this.getContent(this.props.schemaContent, this.props.field, this.props.field.key, this.props.type, this.props.field.description)}
|
||||
</Grid>
|
||||
|
|
|
@ -1,37 +1,37 @@
|
|||
import React, { Component} from 'react';
|
||||
import React, { Component } from 'react';
|
||||
import FlameLinkStructure from './FlameLinkStructure';
|
||||
import FlameLinkCollection from './FlameLinkCollection';
|
||||
import Grid from '@material-ui/core/Grid';
|
||||
|
||||
class FlameLinkComponentCreations extends Component {
|
||||
|
||||
getSchemaFieldData(schemaData, schemaType){
|
||||
getSchemaFieldData(schemaData, schemaType) {
|
||||
var arr = [];
|
||||
for (var val in schemaData){
|
||||
for (var val in schemaData) {
|
||||
arr.push(val);
|
||||
}
|
||||
|
||||
if(schemaType === 'single'){
|
||||
if (schemaType === 'single') {
|
||||
return arr.map(this.createSingleTypeSchemaComponents, schemaData);
|
||||
}
|
||||
if(schemaType === 'collection'){
|
||||
if (schemaType === 'collection') {
|
||||
return this.createCollectionTypeSchemaComponents(schemaData);
|
||||
}
|
||||
else{
|
||||
else {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
createSingleTypeSchemaComponents(num){
|
||||
createSingleTypeSchemaComponents(num) {
|
||||
return <FlameLinkStructure schemaData={this} field={this[num]} type={this[num].type} key={this[num].key} />
|
||||
}
|
||||
|
||||
createCollectionTypeSchemaComponents(schemaData){
|
||||
return <FlameLinkCollection schemaData={schemaData} />
|
||||
createCollectionTypeSchemaComponents = schemaData => {
|
||||
return <FlameLinkCollection schemaName={this.props.schemaName} schemaData={schemaData} />
|
||||
}
|
||||
|
||||
render() {
|
||||
return(
|
||||
return (
|
||||
<Grid container>
|
||||
{this.getSchemaFieldData(this.props.schemaDetails, this.props.schemaType)}
|
||||
</Grid>
|
||||
|
|
|
@ -85,7 +85,7 @@ class ViewSightings extends Component {
|
|||
render() {
|
||||
return (
|
||||
<Fragment>
|
||||
<Grid container>
|
||||
<Grid container className='sighting-container'>
|
||||
<Grid item xs={12} md={6} className='sighting-list'>
|
||||
<Fragment>
|
||||
<List>
|
||||
|
|
|
@ -2,6 +2,14 @@ body {
|
|||
margin: 0;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.sighting-google-map-container > div {
|
||||
height: calc(100% - 64px) !important;
|
||||
}
|
||||
|
||||
@media (min-width: 600px) {
|
||||
.sighting-google-map-container > div {
|
||||
width: calc(100% - 240px) !important;
|
||||
|
@ -9,15 +17,9 @@ body {
|
|||
}
|
||||
}
|
||||
|
||||
@media (min-width: 960px) {
|
||||
.report-google-map-container > div {
|
||||
width: calc(100% - 50% - 120px) !important;
|
||||
}
|
||||
}
|
||||
|
||||
#disqus_thread {
|
||||
width: 89% !important;
|
||||
margin: 0 auto;
|
||||
margin: 100px auto 0 auto;
|
||||
}
|
||||
|
||||
#disqus_thread a,
|
||||
|
@ -30,18 +32,42 @@ body {
|
|||
.sighting-list {
|
||||
height: calc(50vh - 64px);
|
||||
overflow-y: scroll;
|
||||
|
||||
}
|
||||
|
||||
@media (min-width: 960px) {
|
||||
|
||||
.sighting-container {
|
||||
height: calc(100vh - 64px);
|
||||
}
|
||||
|
||||
.sighting-list {
|
||||
height: calc(100vh - 64px);
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.sighting-details {
|
||||
height: calc(100vh - 64px);
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.report-google-map-container > div {
|
||||
height: calc(100% - 64px) !important;
|
||||
width: calc(100% - 50% - 120px) !important;
|
||||
}
|
||||
|
||||
.sighting-detail-google-map-container > div {
|
||||
height: 300px !important;
|
||||
}
|
||||
|
||||
.sighting-detail-google-map-container {
|
||||
position: relative;
|
||||
}
|
||||
}
|
||||
|
||||
.sighting-details-content {
|
||||
width: 89%;
|
||||
margin: 330px auto 0 auto;
|
||||
margin: 0 auto 0 auto;
|
||||
}
|
||||
|
||||
.sighting-detail-google-map-container > div {
|
||||
|
@ -53,10 +79,3 @@ body {
|
|||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@media (min-width: 960px) {
|
||||
.sighting-detail-google-map-container > div {
|
||||
width: calc(100% - 50% - 120px) !important;
|
||||
height: 300px !important;
|
||||
}
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import './css/index.css';
|
||||
import App from './App.js';
|
||||
import registerServiceWorker from './registerServiceWorker';
|
||||
|
||||
|
|
|
@ -1,43 +1,89 @@
|
|||
import React, { Component, Fragment } from 'react';
|
||||
import FlameLinkComponentCreations from '../components/flamelink/FlameLinkComponentCreations';
|
||||
import flamelinkApp from '../utilities/flamelink.js';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Typography } from '@material-ui/core';
|
||||
import { withStyles } from '@material-ui/core/styles';
|
||||
|
||||
const styles = theme => ({
|
||||
header: {
|
||||
paddingRight: 20,
|
||||
paddingLeft: 20,
|
||||
paddingTop: 20,
|
||||
},
|
||||
});
|
||||
|
||||
class About extends Component {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
global.schemaName = 'martenAbout';
|
||||
|
||||
this.state = {
|
||||
schemaDetails: '',
|
||||
schemaType: '',
|
||||
}
|
||||
|
||||
flamelinkApp.schemas.getFields(global.schemaName, { fields: [ 'title', 'key', 'type', 'gridColumns', 'description', 'options' ] })
|
||||
.then(result => this.setState({
|
||||
schemaDetails: result
|
||||
}))
|
||||
|
||||
flamelinkApp.schemas.get(global.schemaName)
|
||||
.then(result => this.setState({
|
||||
schemaType: result.type
|
||||
}))
|
||||
state = {
|
||||
summarySchemaName: 'martenAboutSummary',
|
||||
researcherSchemaName: 'martenAbout',
|
||||
developerSchemaName: 'martenAboutDevelopers',
|
||||
summarySchemaDetails: '',
|
||||
summarySchemaType: '',
|
||||
researcherSchemaDetails: '',
|
||||
researcherSchemaType: '',
|
||||
developerSchemaDetails: '',
|
||||
developerSchemaType: ''
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
document.title = 'Marten Tracker | About';
|
||||
|
||||
|
||||
// Pulling in schema details for summary
|
||||
flamelinkApp.schemas.getFields(this.state.summarySchemaName, { fields: ['title', 'key', 'type', 'gridColumns', 'description', 'options'] })
|
||||
.then(result => this.setState({
|
||||
summarySchemaDetails: result
|
||||
}))
|
||||
|
||||
flamelinkApp.schemas.get(this.state.summarySchemaName)
|
||||
.then(result => this.setState({
|
||||
summarySchemaType: result.type
|
||||
}))
|
||||
|
||||
|
||||
// Pulling in schema details for researchers
|
||||
flamelinkApp.schemas.getFields(this.state.researcherSchemaName, { fields: ['title', 'key', 'type', 'gridColumns', 'description', 'options'] })
|
||||
.then(result => this.setState({
|
||||
researcherSchemaDetails: result
|
||||
}))
|
||||
|
||||
flamelinkApp.schemas.get(this.state.researcherSchemaName)
|
||||
.then(result => this.setState({
|
||||
researcherSchemaType: result.type
|
||||
}))
|
||||
|
||||
|
||||
// Pulling in schema details for developers
|
||||
flamelinkApp.schemas.getFields(this.state.developerSchemaName, { fields: ['title', 'key', 'type', 'gridColumns', 'description', 'options'] })
|
||||
.then(result => this.setState({
|
||||
developerSchemaDetails: result
|
||||
}))
|
||||
|
||||
flamelinkApp.schemas.get(this.state.developerSchemaName)
|
||||
.then(result => this.setState({
|
||||
developerSchemaType: result.type
|
||||
}))
|
||||
}
|
||||
|
||||
render() {
|
||||
const { classes } = this.props;
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Fragment>
|
||||
<FlameLinkComponentCreations schemaDetails = {this.state.schemaDetails} schemaType = {this.state.schemaType}/>
|
||||
<Typography variant="display1" className={classes.header}>Introduction</Typography>
|
||||
<FlameLinkComponentCreations schemaDetails={this.state.summarySchemaDetails} schemaType={this.state.summarySchemaType} schemaName={this.state.summarySchemaName} />
|
||||
<Typography variant="display1" className={classes.header}>Researchers</Typography>
|
||||
<FlameLinkComponentCreations schemaDetails={this.state.researcherSchemaDetails} schemaType={this.state.researcherSchemaType} schemaName={this.state.researcherSchemaName} />
|
||||
<Typography variant="display1" className={classes.header}>Developers</Typography>
|
||||
<FlameLinkComponentCreations schemaDetails={this.state.developerSchemaDetails} schemaType={this.state.developerSchemaType} schemaName={this.state.developerSchemaName} />
|
||||
</Fragment>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default About;
|
||||
About.propTypes = {
|
||||
classes: PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
export default withStyles(styles)(About);
|
||||
|
|
|
@ -111,7 +111,7 @@ const advancedQuiz = {
|
|||
"Eastern gray squirrel",
|
||||
"Red squirrel"
|
||||
],
|
||||
"correctAnswer": "1"
|
||||
"correctAnswer": "3"
|
||||
},
|
||||
{
|
||||
"question": <Fragment>What animal is this?<br /><br /><img src="/quiz-images/advanced/question11.jpg" alt=""></img></Fragment>,
|
||||
|
|
|
@ -100,7 +100,7 @@ const intermediateQuiz = {
|
|||
"Common Grackle",
|
||||
"Common Raven"
|
||||
],
|
||||
"correctAnswer": "1"
|
||||
"correctAnswer": "4"
|
||||
},
|
||||
{
|
||||
"question": <Fragment>What animal is this?<br /><br /><img src="/quiz-images/intermediate/question10.jpg" alt=""></img></Fragment>,
|
||||
|
|