Created
July 9, 2018 01:13
-
-
Save loraxx753/5fc5864d043b702def7c4150477bd742 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from "react"; | |
import firebase from "../firebase.js"; | |
const imageRef = muhImage => { | |
firebase | |
.storage() | |
.ref() | |
.child("images/" + muhImage) | |
.getDownloadURL() | |
.then(function(url) { | |
console.log(url); | |
return url; | |
}) | |
.catch(function(error) { | |
// Handle any errors here | |
}); | |
}; | |
const Image = ({ image }) => { | |
return ( | |
<li> | |
<img | |
src={imageRef(image.fileName)} | |
href={imageRef(image.fileName)} | |
alt="image" | |
/> | |
<div>{image.imageID}</div> | |
<div>{image.imageDate}</div> | |
</li> | |
); | |
}; | |
export default Image; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment