Navigation button
This commit is contained in:
parent
6ca7f0d31f
commit
ebe0f380c5
1 changed files with 24 additions and 0 deletions
24
frontend/src/Components/NavButton.tsx
Normal file
24
frontend/src/Components/NavButton.tsx
Normal file
|
@ -0,0 +1,24 @@
|
|||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
/**
|
||||
* Renders a navigation button component for navigating to
|
||||
* different page
|
||||
* @returns The JSX element representing the navigation button.
|
||||
*/
|
||||
export default function NavButton(props: {
|
||||
navTo: string;
|
||||
label: string;
|
||||
}): JSX.Element {
|
||||
const navigate = useNavigate();
|
||||
const goBack = (): void => {
|
||||
navigate(props.navTo);
|
||||
};
|
||||
return (
|
||||
<button
|
||||
onClick={goBack}
|
||||
className="inline-block py-1 px-8 font-bold bg-orange-500 text-white border-2 border-black rounded-full cursor-pointer mt-5 mb-5 transition-colors duration-10 hover:bg-orange-600 hover:text-gray-300 font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; font-size: 4vh;"
|
||||
>
|
||||
{props.label}
|
||||
</button>
|
||||
);
|
||||
}
|
Loading…
Reference in a new issue