diff --git a/src/Header/DropdownMenu.js b/src/Header/DropdownMenu.js index f4c94bb..dca3cb8 100644 --- a/src/Header/DropdownMenu.js +++ b/src/Header/DropdownMenu.js @@ -1,20 +1,24 @@ -// import OpenPage from "./OpenPage"; -import { useNavigate } from "react-router-dom"; +import OpenPageButton from "./OpenPageButton"; +/** + * @param {null} null - Takes in nothing + * @returns {JSX.Element} JSX - HTML tags and JS functionality + * @description Drop down menu elements + * @author Brock + */ const DropdownMenu = () => { - const navigate = useNavigate(); - - const OpenPage = (arg) => { - navigate(arg); - console.log(arg); - }; - - return ( -
- - -
- ); + return ( +
+ + +
+ ); }; -export default DropdownMenu; \ No newline at end of file +export default DropdownMenu; diff --git a/src/Header/Header.css b/src/Header/Header.css index e69de29..9b9e44b 100644 --- a/src/Header/Header.css +++ b/src/Header/Header.css @@ -0,0 +1,28 @@ +header { + display: flex; + flex-direction: column; + margin: 1%; + margin-top: 0%; +} + +figure { + margin: 0px; + height: 10%; +} + +#logo { + height: 5rem; + background-color: white; +} + +/* not sure what these two are for */ +#title { + background-color: blueviolet; +} +.banner { + display: flex; + flex-direction: row; + align-items: center; + justify-content: flex-start; + background-color: aqua; +} diff --git a/src/Header/Header.js b/src/Header/Header.js index 28daf4d..2b2714e 100644 --- a/src/Header/Header.js +++ b/src/Header/Header.js @@ -1,23 +1,35 @@ import logo from "./logo.png"; import DropdownMenu from "./DropdownMenu"; -// import OpenPage from "./OpenPage"; +import OpenPageButton from "./OpenPageButton"; import { useNavigate, Outlet } from "react-router-dom"; import { useState } from "react"; import "./Header.css"; -export default function Header() { +/** + * @param {null} null - Takes in nothing + * @returns {JSX.Element} JSX - HTML tags and JS functionality + * @description The top header part of the page includes the naviagtion + * @author Brock + */ +const Header = () => { const [isDropdownVisible, setDropdownVisible] = useState(false); const navigate = useNavigate(); - const OpenPage = (arg) => { + /** + * @param {String} arg - The page that the button goes to + * @returns {JSX.Element} JSX - HTML tags and JS functionality + * @description Function that move you to the specified place + * @author Brock + */ + const LinkTo = (arg) => { navigate(arg); - console.log(arg); }; + //makes the drop down menu visible when the mouse enters the Club Membership & Upcoming events button area const handleMouseEnter = () => { setDropdownVisible(true); }; - + //makes the drop down menu invisible when the mouse leaves the Club Membership & Upcoming events button area const handleMouseLeave = () => { setDropdownVisible(false); }; @@ -25,51 +37,52 @@ export default function Header() { return ( <>
-
+
OpenPage("/")} + id="logo" + onClick={() => LinkTo("/")} src={logo} - alt="logo" + alt="Schulich Off-Road's logo" + /> +
+

Schulich Offroad

+
+
+
-
- - - -
- + {/* dropdown menu is only visible when a mouse enters the area of the button below */} + {" "} + {/*this button does nothing yet*/} {isDropdownVisible && }
- -
+ +
); -} +}; + +export default Header; diff --git a/src/Header/OpenPageButton.css b/src/Header/OpenPageButton.css new file mode 100644 index 0000000..342874f --- /dev/null +++ b/src/Header/OpenPageButton.css @@ -0,0 +1,3 @@ +#navigateButton { + text-decoration: none; +} diff --git a/src/Header/OpenPageButton.js b/src/Header/OpenPageButton.js new file mode 100644 index 0000000..025bd90 --- /dev/null +++ b/src/Header/OpenPageButton.js @@ -0,0 +1,27 @@ +import { useNavigate } from "react-router-dom"; +import "./OpenPageButton.css"; + +/** + * @param {String} pageToGoTo - The page that the button goes to + * @param {String} textOnButton - The Text tht will be on the button + * @returns {JSX.Element} JSX - HTML tags and JS functionality + * @description Button Template that moves you to the + * @author Brock + * @todo refactor so that name is OpenPageButton, add css to the button + */ +const OpenPageButton = ({ pageToGoTo, textOnButton }) => { + const navigate = useNavigate(); + const navigateTo = (param) => { + navigate(param); + }; + + return ( + + ); +}; + +export default OpenPageButton; diff --git a/src/Header/logo.png b/src/Header/logo.png index ef3648b..a150fd5 100644 Binary files a/src/Header/logo.png and b/src/Header/logo.png differ