From 9556e0eb99fb0cd6333ce19295f8e783c9c42a82 Mon Sep 17 00:00:00 2001 From: ajmaley Date: Thu, 4 Oct 2018 19:14:48 -0400 Subject: [PATCH] Added flamelink features --- src/components/Flamelink.js | 5 +++-- src/components/Main.js | 12 +----------- src/firebase.js | 1 + src/flamelink.js | 6 ++++++ 4 files changed, 11 insertions(+), 13 deletions(-) create mode 100644 src/flamelink.js diff --git a/src/components/Flamelink.js b/src/components/Flamelink.js index c078221..4033d59 100644 --- a/src/components/Flamelink.js +++ b/src/components/Flamelink.js @@ -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); diff --git a/src/components/Main.js b/src/components/Main.js index 2863183..2259d17 100644 --- a/src/components/Main.js +++ b/src/components/Main.js @@ -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 && } {value === 3 && } {value === 4 && } - {value === 5 && } + {value === 5 && } ); } diff --git a/src/firebase.js b/src/firebase.js index f26bb7a..8d01e36 100644 --- a/src/firebase.js +++ b/src/firebase.js @@ -11,4 +11,5 @@ const config = { }; firebase.initializeApp(config); + export default firebase; \ No newline at end of file diff --git a/src/flamelink.js b/src/flamelink.js new file mode 100644 index 0000000..4ac805f --- /dev/null +++ b/src/flamelink.js @@ -0,0 +1,6 @@ +import firebaseApp from './firebase.js'; +import flamelink from 'flamelink'; + +const flamelinkApp = flamelink({ firebaseApp }); + +export default flamelinkApp; \ No newline at end of file