Skip to content

Commit

Permalink
Refactor PitScoutingCard to replace Button with anchor tags for navig…
Browse files Browse the repository at this point in the history
…ation and remove useRouter
  • Loading branch information
renatodellosso committed Dec 14, 2024
1 parent 7a8b11d commit 145218a
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions components/competition/PitScoutingCard.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { NotLinkedToTba } from "@/lib/client/ClientUtils";
import { Competition, Pitreport } from "@/lib/Types";
import Link from "next/link";
import { useRouter } from "next/router";
import { Button } from "react-bootstrap";
import { BsGearFill } from "react-icons/bs";
import { FaRobot } from "react-icons/fa";

Expand All @@ -13,8 +11,6 @@ export default function PitScoutingCard(props: {
}) {
const { pitreports, loadingPitreports, comp } = props;

const router = useRouter();

return (
<div className="w-full card bg-base-200 shadow-xl h-56">
{pitreports.length === 0 && !loadingPitreports ? (
Expand Down Expand Up @@ -43,9 +39,9 @@ export default function PitScoutingCard(props: {
pitreports
?.sort((a, b) => a.teamNumber - b.teamNumber)
?.map((report) => (
<Button
<a
className="card mt-2 bg-base-100 hover:bg-base-200 p-2 h-3/4"
onClick={() => router.push(`/pit/${report._id}`)}
href={`${window.location.pathname}/pit/${report._id}`}
key={report._id}
>
<div className="relative rounded-t-lg h-6 z-20 w-16 -translate-y-2 font-bold text-center">
Expand All @@ -64,7 +60,7 @@ export default function PitScoutingCard(props: {
<FaRobot size={64} />
)}
</div>
</Button>
</a>
))
)}
</div>
Expand Down

0 comments on commit 145218a

Please sign in to comment.