diff --git a/src/components/App.js b/src/components/App.js index 7d8709e..ad06133 100644 --- a/src/components/App.js +++ b/src/components/App.js @@ -3,11 +3,6 @@ import { BrowserRouter, Routes, Route, Link } from "react-router-dom"; import { getAuth, signOut } from "firebase/auth"; import { auth } from "../firebase/config" -import ProfileButton from "./buttons/ProfileButton"; -import LogoutButton from "./buttons/LogoutButton"; -import HomeButton from "./buttons/HomeButton"; -import CreateItemButton from "./buttons/CreateItemButton"; - import HomePage from "./pages/HomePage"; import ProfilePage from "./pages/ProfilePage"; import AddShirtPage from "./pages/AddShirtPage"; @@ -15,53 +10,27 @@ import Login from "../components/pages/login"; import SignUp from "../components/pages/signup"; import HomeFeed from "./pages/HomeFeed"; import ShirtCard from "../components/ShirtCard" -import { faRightFromBracket } from "@fortawesome/free-solid-svg-icons"; -import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import Layout from "./Layout"; function App() { - const handleSignout = () => { - signOut(auth) - .then(() => { - // Sign-out successful. - console.log('user signed out'); - }) - .catch((error) => { - // An error happened. - console.log(error); - }); - }; + + return ( -
- - - - - - - - - - - - - - - -
- {/* }> */} - }> - }> - }> - }> + }> + }> + }> + }> + }> + }> + + }> }> - }>
); } + export default App; diff --git a/src/components/AuthRequired.js b/src/components/AuthRequired.js new file mode 100644 index 0000000..8e0e02b --- /dev/null +++ b/src/components/AuthRequired.js @@ -0,0 +1,16 @@ +// import React from 'react' +// import { Outlet } from "react-router-dom" +// import { auth } from "../firebase/config" + +// const AuthRequired = () => { +// const isLoggedIn = auth; +// return ( +// if(isLoggedIn) { + +// } + +// +// ) +// } + +// export default AuthRequired \ No newline at end of file diff --git a/src/components/Header.js b/src/components/Header.js new file mode 100644 index 0000000..232aee1 --- /dev/null +++ b/src/components/Header.js @@ -0,0 +1,38 @@ +import React from 'react' +import ProfileButton from "./buttons/ProfileButton"; +import LogoutButton from "./buttons/LogoutButton"; +import HomeButton from "./buttons/HomeButton"; +import CreateItemButton from "./buttons/CreateItemButton"; + + +import { BrowserRouter, Routes, Route, Link } from "react-router-dom"; + + + +const Header = () => { + + return ( +
+ +
+ ) +} + +export default Header \ No newline at end of file diff --git a/src/components/Layout.js b/src/components/Layout.js new file mode 100644 index 0000000..4328f48 --- /dev/null +++ b/src/components/Layout.js @@ -0,0 +1,14 @@ +import React from 'react' +import { Outlet } from "react-router-dom" +import Header from './Header' + +const Layout = () => { + return ( + <> +
+ + + ) +} + +export default Layout \ No newline at end of file diff --git a/src/components/ShirtCard.js b/src/components/ShirtCard.js index 69c6685..93e0fed 100644 --- a/src/components/ShirtCard.js +++ b/src/components/ShirtCard.js @@ -11,7 +11,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; const fetchShirtData = async () => { const querySnapshot = await getDocs(collection(db, "shirt-uploads")); const data = querySnapshot.docs.map((doc) => doc.data()); - console.log(data); + return data; }; const handleDelete = async (shirtId) => { @@ -33,9 +33,9 @@ const ShirtCard = () => { }, []); return (
- {shirts.map((shirt) => ( + {shirts.map((shirt, index) => (

Football Club: {shirt.club}

diff --git a/src/components/buttons/LogoutButton.js b/src/components/buttons/LogoutButton.js index 5fc6eec..a95e8b8 100644 --- a/src/components/buttons/LogoutButton.js +++ b/src/components/buttons/LogoutButton.js @@ -1,6 +1,8 @@ import { useState } from "react"; import React from "react"; import { getAuth, signOut } from "firebase/auth"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { faRightFromBracket } from "@fortawesome/free-solid-svg-icons"; const auth = getAuth(); @@ -21,9 +23,12 @@ const LogoutButton = () => { }; return ( -
- -
+ + + ); };