Skip to content

Commit 4633adc

Browse files
committed
fix(frontend): resolve linting errors and build issues
- Fix unused vars and unescaped entities in Waitlist.tsx - Remove unused imports in PredictionList.tsx - Fix explicit any in StakedChart.tsx - Fix conditional hook usage in checkbox.tsx - Fix unused id prop in toast.tsx
1 parent cf1e1f7 commit 4633adc

File tree

5 files changed

+22
-12
lines changed

5 files changed

+22
-12
lines changed

frontend/components/Waitlist.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"use client";
22

33
import { useState, FormEvent } from "react";
4+
import Link from "next/link";
45

56
export default function Waitlist() {
67
const [email, setEmail] = useState("");
@@ -39,7 +40,7 @@ export default function Waitlist() {
3940
setStatus("success");
4041
setName("");
4142
setEmail("");
42-
} catch (error) {
43+
} catch (_error) {
4344
setStatus("error");
4445
setErrorMessage("Something went wrong. Please try again.");
4546
}
@@ -132,23 +133,23 @@ export default function Waitlist() {
132133
</svg>
133134
</div>
134135
<h3 className="text-2xl font-bold text-white">
135-
You're on the list!
136+
You&apos;re on the list!
136137
</h3>
137138
<p className="text-gray-400">
138-
We'll notify you when PrediFi launches. Get ready to predict!
139+
We&apos;ll notify you when PrediFi launches. Get ready to predict!
139140
</p>
140141
</div>
141142
)}
142143

143144
{/* Footer */}
144145
<p className="mt-8 text-center text-sm text-gray-500">
145146
Already have an account?{" "}
146-
<a
147+
<Link
147148
href="/login"
148149
className="text-[#00D9D9] hover:text-[#00c4c4] font-medium transition-colors"
149150
>
150151
Sign in
151-
</a>
152+
</Link>
152153
</p>
153154
</div>
154155
</div>

frontend/components/dashboard/PredictionList.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
import { useState } from "react";
44
import { cn } from "@/lib/utils";
55
import { Card, CardContent } from "@/components/ui/card";
6-
import { Button } from "@/components/ui/button";
76
import { ChefHat, ChevronRight, Users, Copy } from "lucide-react";
8-
import Image from "next/image";
97

108
interface Prediction {
119
id: string;

frontend/components/dashboard/StakedChart.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,23 @@ const data = [
2020
{ name: "DEC", value: 60000 },
2121
];
2222

23-
const CustomTooltip = ({ active, payload, label }: any) => {
23+
const CustomTooltip = ({
24+
active,
25+
payload,
26+
label,
27+
}: {
28+
active?: boolean;
29+
payload?: { value: number }[];
30+
label?: string | number;
31+
}) => {
2432
if (active && payload && payload.length) {
33+
const value = payload[0].value ?? 0;
2534
return (
2635
<div className="bg-zinc-900 border border-white/10 p-2 rounded-lg shadow-xl">
2736
<p className="text-zinc-400 text-xs mb-1">{label}</p>
2837
<p className="text-white font-bold font-mono">
2938
{/* Formatter for currency */}
30-
${(payload[0].value / 1000).toFixed(0)}k
39+
${((value as number) / 1000).toFixed(0)}k
3140
</p>
3241
</div>
3342
);

frontend/components/ui/checkbox.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ const Checkbox = React.forwardRef<
3131
},
3232
ref
3333
) => {
34-
const checkboxId = id || React.useId();
34+
const generatedId = React.useId();
35+
const checkboxId = id ?? generatedId;
3536
const isIndeterminate = indeterminate && checked !== true;
3637

3738
return (
@@ -52,8 +53,8 @@ const Checkbox = React.forwardRef<
5253
error
5354
? `${checkboxId}-error`
5455
: helperText
55-
? `${checkboxId}-helper`
56-
: undefined
56+
? `${checkboxId}-helper`
57+
: undefined
5758
}
5859
{...props}
5960
>

frontend/components/ui/toast.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ const Toast = React.forwardRef<HTMLDivElement, ToastProps>(
5454
return (
5555
<div
5656
ref={ref}
57+
data-id={id}
5758
className={cn(toastVariants({ variant }))}
5859
role="alert"
5960
aria-live="assertive"

0 commit comments

Comments
 (0)