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