mirror of
https://github.com/UofCBaja/BajaUofCWebsite.git
synced 2025-06-15 21:34:17 -06:00
change openpage to OpenPageButton
This commit is contained in:
parent
49510e81ac
commit
78509673cc
3
src/Header/OpenPageButton.css
Normal file
3
src/Header/OpenPageButton.css
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#navigateButton {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
27
src/Header/OpenPageButton.js
Normal file
27
src/Header/OpenPageButton.js
Normal file
@ -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 <darkicewolf50@gmail.com>
|
||||||
|
* @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 (
|
||||||
|
<button
|
||||||
|
id="navigateButton"
|
||||||
|
onClick={() => navigateTo(pageToGoTo)}>
|
||||||
|
{textOnButton}
|
||||||
|
</button>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default OpenPageButton;
|
Loading…
x
Reference in New Issue
Block a user