Skip to content

Commit 7a271e4

Browse files
committed
fix: use link navigation where possible
1 parent 9cc7dce commit 7a271e4

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

src/pages/EditionSelection.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,13 @@ export default function EditionSelection() {
101101
<CardContent>
102102
<Button
103103
variant="outline"
104-
onClick={() => navigate("/")}
104+
asChild
105105
className="w-full border-purple-400 text-purple-400 hover:bg-purple-400 hover:text-white"
106106
>
107-
<ArrowLeft className="h-4 w-4 mr-2" />
108-
Back to Festivals
107+
<Link to="/">
108+
<ArrowLeft className="h-4 w-4 mr-2" />
109+
Back to Festivals
110+
</Link>
109111
</Button>
110112
</CardContent>
111113
</Card>

src/pages/ExploreSetPage/ExploreSetPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export function ExploreSetPage() {
143143
setSkippedCount((prev) => prev + 1);
144144
setTimeout(() => {
145145
if (isLastSet) {
146-
navigate(-1);
146+
navigate(`${basePath}/sets`);
147147
} else {
148148
setCurrentIndex((prev) => prev + 1);
149149
setDirection(null);

src/pages/groups/GroupDetail.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useEffect, useState } from "react";
2-
import { useParams, useNavigate } from "react-router-dom";
2+
import { useParams, useNavigate, Link } from "react-router-dom";
33
import { TopBar } from "@/components/layout/TopBar";
44
import {
55
Card,
@@ -82,8 +82,8 @@ function GroupDetail() {
8282
</CardDescription>
8383
</CardHeader>
8484
<CardContent>
85-
<Button onClick={() => navigate("/")} className="w-full">
86-
Go to Home
85+
<Button asChild className="w-full">
86+
<Link to="/">Go to Home</Link>
8787
</Button>
8888
</CardContent>
8989
</Card>
@@ -111,8 +111,8 @@ function GroupDetail() {
111111
</CardDescription>
112112
</CardHeader>
113113
<CardContent>
114-
<Button onClick={() => navigate("/groups")} className="w-full">
115-
Back to Groups
114+
<Button asChild className="w-full">
115+
<Link to="/groups">Back to Groups</Link>
116116
</Button>
117117
</CardContent>
118118
</Card>

src/pages/groups/Groups/SignInRequired.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ import {
66
CardContent,
77
} from "@/components/ui/card";
88
import { Button } from "@/components/ui/button";
9-
import { useNavigate } from "react-router-dom";
9+
import { Link } from "react-router-dom";
1010

1111
export function SignInRequired() {
12-
const navigate = useNavigate();
1312
return (
1413
<div className="min-h-screen bg-app-gradient flex items-center justify-center">
1514
<Card className="w-full max-w-md">
@@ -18,8 +17,8 @@ export function SignInRequired() {
1817
<CardDescription>Please sign in to manage groups</CardDescription>
1918
</CardHeader>
2019
<CardContent>
21-
<Button onClick={() => navigate("/")} className="w-full">
22-
Go to Home
20+
<Button asChild className="w-full">
21+
<Link to="/">Go to Home</Link>
2322
</Button>
2423
</CardContent>
2524
</Card>

0 commit comments

Comments
 (0)