fix: lints

This commit is contained in:
Alexander Medvedev 2026-04-26 10:28:08 +02:00
parent 4de3327b20
commit c5e08f120d
10 changed files with 22 additions and 34 deletions

View File

@ -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<any>(null);
const [plugins, setPlugins] = useState<any[]>([]);
const [loading, setLoading] = useState(true);

View File

@ -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();

View File

@ -91,7 +91,6 @@ const PluginDetail = () => {
const [lightboxIndex, setLightboxIndex] = useState<number>(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 ? (
<form onSubmit={(e) => submitReviewReport(e, r.id)} className="report-form" style={{ maxWidth: '400px', width: '100%' }}>
<label className="report-form-label">Reason for reporting this review</label>
<div className="report-reasons" style={{ transform: 'scale(0.9)', originX: 'left' }}>
<div className="report-reasons" style={{ transform: 'scale(0.9)', transformOrigin: 'left' }}>
{REVIEW_REPORT_REASONS.map(reason => (
<button
key={reason}

View File

@ -1,4 +1,4 @@
import React, { useState, useEffect } from 'react';
import { useState, useEffect } from 'react';
import api from '../../api';
import './AdminPanel.css';

View File

@ -2,7 +2,6 @@ import React, { useState } from 'react';
import { Link, useNavigate } from 'react-router-dom';
import { Turnstile } from '@marsidev/react-turnstile';
import api from '../../api';
import { useAuth } from '../../App';
interface PasswordRequirement {
label: string;
@ -32,13 +31,11 @@ const RegisterPage = () => {
const [captchaToken, setCaptchaToken] = useState<string | null>(null);
const [error, setError] = useState('');
const [isSubmitting, setIsSubmitting] = useState(false);
const [focusedField, setFocusedField] = useState<string | null>(null);
const [emailTouched, setEmailTouched] = useState(false);
const [emailValid, setEmailValid] = useState<boolean | null>(null);
const [passwordTouched, setPasswordTouched] = useState(false);
const [showPassword, setShowPassword] = useState(false);
const navigate = useNavigate();
const { login } = useAuth();
const validateEmail = (email: string) =>
Boolean(String(email).toLowerCase().match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/));
@ -50,7 +47,6 @@ const RegisterPage = () => {
};
const handleEmailBlur = () => {
setFocusedField(null);
setEmailTouched(true);
setEmailValid(form.email === '' ? null : validateEmail(form.email));
};
@ -277,7 +273,6 @@ const RegisterPage = () => {
<input
id="username" className="field-input" type="text" placeholder="johndoe"
onChange={e => setForm({ ...form, username: e.target.value })}
onFocus={() => setFocusedField('username')} onBlur={() => setFocusedField(null)}
required disabled={isSubmitting} autoComplete="username"
autoCapitalize="none" spellCheck={false}
/>
@ -291,9 +286,9 @@ const RegisterPage = () => {
<input
id="email"
className={`field-input${emailIsInvalid ? ' email-invalid' : ''}${emailIsValid ? ' email-valid' : ''}`}
type="email" placeholder="you@company.com" value={form.email}
type="email" placeholder="you@company.com"
value={form.email}
onChange={handleEmailChange}
onFocus={() => setFocusedField('email')}
onBlur={handleEmailBlur}
required disabled={isSubmitting} autoComplete="email"
/>
@ -340,8 +335,6 @@ const RegisterPage = () => {
placeholder="Create a strong password"
value={form.password}
onChange={handlePasswordChange}
onFocus={() => setFocusedField('password')}
onBlur={() => setFocusedField(null)}
required disabled={isSubmitting} autoComplete="new-password"
/>
<button
@ -422,7 +415,7 @@ const RegisterPage = () => {
<div className="captcha-container">
<Turnstile siteKey="0x4AAAAAAClcSibyhKfR0H6o"
onSuccess={(token) => setCaptchaToken(token)} theme="light" />
onSuccess={(token) => setCaptchaToken(token)} options={{ theme: 'light' } as any} />
</div>
<button className="submit-btn" type="submit" disabled={isSubmitting}>

View File

@ -51,13 +51,13 @@ const VerifyEmailPage = () => {
<p>You are now logged in. Redirecting to the homepage...</p>
</div>
)}
{/* {status === 'error' && (
{status === 'error' && (
<div>
<h1>Verification Failed</h1>
<p>{error}</p>
<p>Please try registering again or contact support.</p>
</div>
)} */}
)}
</div>
);
};

View File

@ -48,7 +48,7 @@ const DashboardAudience = () => {
</div>
<div className="map-wrapper" style={{ background: '#0f0f1a', borderRadius: '12px', padding: '20px', border: '1px solid var(--border)' }}>
<ComposableMap projectionConfig={{ rotate: [-10, 0, 0], scale: 147 }} width={800} height={400}>
<ComposableMap projectionConfig={{ rotate: [-10, 0, 0] as any, scale: 147 }} width={800} height={400}>
<Geographies geography={GEO_URL}>
{({ geographies }) =>
geographies.map((geo) => {

View File

@ -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 (
<div className="custom-tooltip-v2">
@ -27,7 +26,7 @@ const CustomTooltip = ({ active, payload, label }) => {
return null;
};
const MiniChart = ({ data, color, dataKey }) => (
const MiniChart = ({ data, color, dataKey }: any) => (
<div style={{ width: '80px', height: '40px' }}>
<ResponsiveContainer width="100%" height="100%">
<LineChart data={data}>
@ -44,7 +43,7 @@ const MiniChart = ({ data, color, dataKey }) => (
</div>
);
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}
/>
<Tooltip content={<CustomTooltip />} />
<Tooltip content={<CustomTooltip active={undefined} payload={undefined} label={undefined} />} />
<Area
type="monotone"
dataKey="earnings"
@ -183,7 +182,7 @@ const DashboardOverview = () => {
</div>
<div className="feed-list">
{recentActivity && recentActivity.length > 0 ? (
recentActivity.map((activity) => (
recentActivity.map((activity: any) => (
<div key={activity.id} className="feed-item-v2">
<div className="feed-avatar">
{activity.userInitials || <User size={14} />}
@ -210,4 +209,4 @@ const DashboardOverview = () => {
);
};
export default DashboardOverview;
export default DashboardOverview;

View File

@ -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,

View File

@ -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';