Added flamelink features

This commit is contained in:
ajmaley 2018-10-04 19:14:48 -04:00
parent 1e61914815
commit 9556e0eb99
4 changed files with 11 additions and 13 deletions

View File

@ -1,10 +1,11 @@
import React, { Component } from 'react';
import { Component } from 'react';
import flamelinkApp from '../flamelink.js';
class Flamelink extends Component {
render() {
//Grabs data from text field in entry from the martenSchemaDemo
this.props.flamelinkApp.content.get('martenSchemaDemo')
flamelinkApp.content.get('martenSchemaDemo')
.then(flameData => document.getElementById("flamelinkDemo").innerHTML = flameData.field_1538162314419);
return(null);

View File

@ -11,7 +11,6 @@ import Quiz from '../pages/Quiz';
import SightingList from '../pages/SightingList';
import Report from '../pages/Report';
import Info from '../pages/Info';
import flamelink from 'flamelink';
function TabContainer(props) {
return (
@ -32,15 +31,6 @@ const styles = theme => ({
},
});
const flamelinkApp = flamelink({
apiKey: "AIzaSyAYf9AbeYwLY892NRiQfn0AMtG9xIFAJbo",
authDomain: "marten-application.firebaseapp.com",
databaseURL: "https://marten-application.firebaseio.com",
projectId: "marten-application",
storageBucket: "marten-application.appspot.com",
messagingSenderId: "659856510832"
});
class SimpleTabs extends React.Component {
state = {
value: 0,
@ -71,7 +61,7 @@ class SimpleTabs extends React.Component {
{value === 2 && <SightingList/>}
{value === 3 && <Quiz/>}
{value === 4 && <ViewMap/>}
{value === 5 && <Info flamelinkApp={flamelinkApp}/>}
{value === 5 && <Info/>}
</div>
);
}

View File

@ -11,4 +11,5 @@ const config = {
};
firebase.initializeApp(config);
export default firebase;

6
src/flamelink.js Normal file
View File

@ -0,0 +1,6 @@
import firebaseApp from './firebase.js';
import flamelink from 'flamelink';
const flamelinkApp = flamelink({ firebaseApp });
export default flamelinkApp;