From 93b4f2de62f65f89808d49ef558972dadac97276 Mon Sep 17 00:00:00 2001 From: "Rayyan (Rayy)" Date: Tue, 24 Oct 2023 07:45:48 +0000 Subject: [PATCH] Add Firebase Storage for Book Covers --- src/App.js | 5 +++++ src/contexts/StorageContext.js | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 src/contexts/StorageContext.js diff --git a/src/App.js b/src/App.js index efc8901..e4b5a63 100644 --- a/src/App.js +++ b/src/App.js @@ -12,6 +12,7 @@ import { getFirestore, query, where, getDocs } from "firebase/firestore"; + import {getStorage} from "firebase/storage" import { Header } from "./components/Header" import './App.css' @@ -24,6 +25,7 @@ import { Signin } from "./pages/Signin" // contexts import { AuthContext } from "./contexts/AuthContext" +import { StorageContext } from "./contexts/StorageContext"; @@ -31,6 +33,7 @@ function App() { const FBapp = initializeApp(FirebaseConfig) const FBauth = getAuth(FBapp) const FBdb = getFirestore(FBapp) + const FBstorage = getStorage(FBapp) // navigation array @@ -129,6 +132,7 @@ const readData = async () => {
+ } /> } /> @@ -137,6 +141,7 @@ const readData = async () => { } /> } /> +
); diff --git a/src/contexts/StorageContext.js b/src/contexts/StorageContext.js new file mode 100644 index 0000000..3bc4943 --- /dev/null +++ b/src/contexts/StorageContext.js @@ -0,0 +1,3 @@ +import { createContext } from "react"; + +export const StorageContext = createContext() \ No newline at end of file