From 44aea9b765bf848f935bcdd411675dcd826f1668 Mon Sep 17 00:00:00 2001 From: Peter KW Date: Fri, 15 Mar 2024 14:51:46 +0100 Subject: [PATCH] Made a back button component since we will have one on almost every page --- frontend/src/Components/BackButton.tsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 frontend/src/Components/BackButton.tsx diff --git a/frontend/src/Components/BackButton.tsx b/frontend/src/Components/BackButton.tsx new file mode 100644 index 0000000..7a1ac81 --- /dev/null +++ b/frontend/src/Components/BackButton.tsx @@ -0,0 +1,18 @@ +import { useNavigate } from "react-router-dom"; + +function BackButton(): JSX.Element { + const navigate = useNavigate(); + const goBack = (): void => { + navigate(-1); + }; + return ( + + ); +} + +export default BackButton;