From c5e08f120dc87a04fbd5d3b7e0b66a00fe74f98b Mon Sep 17 00:00:00 2001 From: Alexander Medvedev Date: Sun, 26 Apr 2026 10:28:08 +0200 Subject: [PATCH] fix: lints --- src/pages/AuthorProfilePage.tsx | 4 ++-- src/pages/Home.tsx | 2 +- src/pages/PluginDetail.tsx | 6 +----- src/pages/admin/AdminPanel.tsx | 2 +- src/pages/auth/RegisterPage.tsx | 13 +++---------- src/pages/auth/VerifyEmailPage.tsx | 4 ++-- src/pages/dashboard/DashboardAudience.tsx | 2 +- src/pages/dashboard/DashboardOverview.tsx | 17 ++++++++--------- src/pages/dashboard/plugin/AddPlugin.tsx | 2 +- src/pages/dashboard/plugin/ManagePlugin.tsx | 4 ++-- 10 files changed, 22 insertions(+), 34 deletions(-) diff --git a/src/pages/AuthorProfilePage.tsx b/src/pages/AuthorProfilePage.tsx index 8dc99fa..9c1b92f 100644 --- a/src/pages/AuthorProfilePage.tsx +++ b/src/pages/AuthorProfilePage.tsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect } from 'react'; +import { useState, useEffect } from 'react'; import { useParams, Link } from 'react-router-dom'; import api from '../api'; import { useTranslation } from 'react-i18next'; @@ -6,7 +6,7 @@ import SEO from '../components/SEO'; const AuthorProfilePage = () => { const { username } = useParams(); - const { t, i18n } = useTranslation(); + const { i18n } = useTranslation(); const [author, setAuthor] = useState(null); const [plugins, setPlugins] = useState([]); const [loading, setLoading] = useState(true); diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx index 4c8c55a..e509c40 100644 --- a/src/pages/Home.tsx +++ b/src/pages/Home.tsx @@ -1,8 +1,8 @@ import { useState, useEffect, useRef } from 'react'; -import { Link } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; import api from '../api'; import SEO from '../components/SEO'; +import PluginCard from '../components/PluginCard'; const Home = () => { const { t } = useTranslation(); diff --git a/src/pages/PluginDetail.tsx b/src/pages/PluginDetail.tsx index 38c1e67..037f549 100644 --- a/src/pages/PluginDetail.tsx +++ b/src/pages/PluginDetail.tsx @@ -91,7 +91,6 @@ const PluginDetail = () => { const [lightboxIndex, setLightboxIndex] = useState(0); const [selectedLanguage] = useState('en'); const [currentDescription, setCurrentDescription] = useState(''); - const [loading, setLoading] = useState(true); // Ownership const [ownsPlugin, setOwnsPlugin] = useState(false); @@ -133,7 +132,6 @@ const PluginDetail = () => { const fetchPlugin = () => { api.get(`/plugins/${id}`).then(res => { setPlugin(res.data); - setLoading(false); if (res.data.screenshots?.length > 0) { setMainScreenshot(res.data.screenshots[0].path); } @@ -251,7 +249,6 @@ const PluginDetail = () => { // Does not own — go to Stripe checkout try { - setLoading(true); const res = await api.post(`/plugins/${id}/checkout`); if (res.data.url) window.location.href = res.data.url; } catch (err: any) { @@ -264,7 +261,6 @@ const PluginDetail = () => { alert('Checkout failed. Please try again.'); } } finally { - setLoading(false); } return; } @@ -587,7 +583,7 @@ const PluginDetail = () => { ) : reviewReportOpen === r.id ? (
submitReviewReport(e, r.id)} className="report-form" style={{ maxWidth: '400px', width: '100%' }}> -
+
{REVIEW_REPORT_REASONS.map(reason => (
)} - {/* {status === 'error' && ( + {status === 'error' && (

Verification Failed

{error}

Please try registering again or contact support.

- )} */} + )}
); }; diff --git a/src/pages/dashboard/DashboardAudience.tsx b/src/pages/dashboard/DashboardAudience.tsx index 3ce9886..3915bf3 100644 --- a/src/pages/dashboard/DashboardAudience.tsx +++ b/src/pages/dashboard/DashboardAudience.tsx @@ -48,7 +48,7 @@ const DashboardAudience = () => {
- + {({ geographies }) => geographies.map((geo) => { diff --git a/src/pages/dashboard/DashboardOverview.tsx b/src/pages/dashboard/DashboardOverview.tsx index f6737cc..5f7a163 100644 --- a/src/pages/dashboard/DashboardOverview.tsx +++ b/src/pages/dashboard/DashboardOverview.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import { AreaChart, Area, XAxis, YAxis, Tooltip, ResponsiveContainer, LineChart, Line @@ -10,12 +9,12 @@ import { import { useAnalytics } from './useAnalytics'; // Helper for formatting large numbers -const formatValue = (val) => { +const formatValue = (val: number) => { if (val >= 1000) return `${(val / 1000).toFixed(1)}k`; - return val; + return val.toString(); }; -const CustomTooltip = ({ active, payload, label }) => { +const CustomTooltip = ({ active, payload, label }: any) => { if (active && payload && payload.length) { return (
@@ -27,7 +26,7 @@ const CustomTooltip = ({ active, payload, label }) => { return null; }; -const MiniChart = ({ data, color, dataKey }) => ( +const MiniChart = ({ data, color, dataKey }: any) => (
@@ -44,7 +43,7 @@ const MiniChart = ({ data, color, dataKey }) => (
); -const KpiCard = ({ title, value, comparison, icon: Icon, chartData, dataKey }) => { +const KpiCard = ({ title, value, comparison, icon: Icon, chartData, dataKey }: any) => { // Logic Fix: Handle 0% as neutral const trendValue = parseFloat(comparison) || 0; const isPositive = trendValue > 0; @@ -161,7 +160,7 @@ const DashboardOverview = () => { tick={{fill: '#94a3b8', fontSize: 12}} tickFormatter={formatValue} /> - } /> + } /> {
{recentActivity && recentActivity.length > 0 ? ( - recentActivity.map((activity) => ( + recentActivity.map((activity: any) => (
{activity.userInitials || } @@ -210,4 +209,4 @@ const DashboardOverview = () => { ); }; -export default DashboardOverview; \ No newline at end of file +export default DashboardOverview; diff --git a/src/pages/dashboard/plugin/AddPlugin.tsx b/src/pages/dashboard/plugin/AddPlugin.tsx index e683bc0..aa35352 100644 --- a/src/pages/dashboard/plugin/AddPlugin.tsx +++ b/src/pages/dashboard/plugin/AddPlugin.tsx @@ -1,4 +1,4 @@ -import React, { useState, useRef, useEffect, useMemo } from 'react'; +import { useState, useRef, useEffect, useMemo } from 'react'; import { useNavigate } from 'react-router-dom'; import { Globe, ImageIcon, Plus, Search, X, Upload, FileCode, diff --git a/src/pages/dashboard/plugin/ManagePlugin.tsx b/src/pages/dashboard/plugin/ManagePlugin.tsx index 712348b..caaa4ad 100644 --- a/src/pages/dashboard/plugin/ManagePlugin.tsx +++ b/src/pages/dashboard/plugin/ManagePlugin.tsx @@ -1,9 +1,9 @@ -import React, { useState, useEffect } from 'react'; +import { useState, useEffect } from 'react'; import { useNavigate, useParams } from 'react-router-dom'; import api from '../../../api'; import { LayoutGrid, Tag, Upload, DollarSign, Trash2, - ChevronLeft, Circle + Circle } from 'lucide-react'; import StoreListing from './StoreListing';