Skip to content

Commit

Permalink
Use redirectToLogin instead of a Link
Browse files Browse the repository at this point in the history
  • Loading branch information
gf-rog committed Mar 6, 2024
1 parent 6f3f705 commit f88dc9f
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions frontend/src/layout/WelcomeMessage.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useUser } from "../helpers/UserContext";
import LogoSVG from "/logo.svg";
import { Link } from "react-router-dom";

Expand All @@ -6,6 +7,8 @@ const scrollToTop = (): void => {
};

export default function WelcomeMessage() {
const { redirectToLogin } = useUser();

return (
<div className="relative overflow-hidden" id="background">
<div
Expand Down Expand Up @@ -44,14 +47,13 @@ export default function WelcomeMessage() {
className=" z-50 flex flex-col lg:flex-row"
id="buttons-section"
>
<Link to="/login">
<button
className="btn primary w-64 m-5 fade-in"
id="login-button"
>
Login
</button>
</Link>
<button
className="btn primary w-64 m-5 fade-in"
id="login-button"
onClick={() => redirectToLogin()}
>
Login
</button>
<Link to="/register">
<button
className="btn secondary w-64 m-5 text-my-light fade-in"
Expand Down

0 comments on commit f88dc9f

Please sign in to comment.