From f7d1e001ce7314502e2b9b51e56e58e8f8ce5eac Mon Sep 17 00:00:00 2001 From: Halyna Riabokonenko Date: Sun, 3 Mar 2024 20:52:03 +0100 Subject: [PATCH] implement solution of showing items at basket --- my-app/src/App.jsx | 62 +++++++---- .../Components/BasketModal/BasketModal.jsx | 100 +++++++++++------- .../BasketModal/BasketModal.module.css | 37 ++++++- my-app/src/Components/Header/Header.jsx | 9 +- .../PortfolioImage/PortfolioImage.jsx | 42 +++++++- 5 files changed, 182 insertions(+), 68 deletions(-) diff --git a/my-app/src/App.jsx b/my-app/src/App.jsx index 1ee8f79..f1adb0c 100644 --- a/my-app/src/App.jsx +++ b/my-app/src/App.jsx @@ -14,6 +14,7 @@ import { Footer } from "./Components/Footer/Footer"; import { auth } from "./../firebase-config.js"; import { useState } from "react"; import { onAuthStateChanged } from "firebase/auth"; +import { BasketModal } from "./Components/BasketModal/BasketModal.jsx"; function App() { const quotes = [ @@ -22,6 +23,7 @@ function App() { ]; const [user, setUser] = useState(null); + onAuthStateChanged(auth, (res) => { setUser(res); }); @@ -33,29 +35,45 @@ function App() {
- }> - : } - > - : } - > - }> - : } - > + {user ? ( + <> + } + > + : } + > + : } + > + }> + : } + > + : } + > + + ) : ( + <> + : } + > + : + } + > + + )} }> - : } - > - : } - >