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 { useParams, Link } from 'react-router-dom';
import api from '../api'; import api from '../api';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
@ -6,7 +6,7 @@ import SEO from '../components/SEO';
const AuthorProfilePage = () => { const AuthorProfilePage = () => {
const { username } = useParams(); const { username } = useParams();
const { t, i18n } = useTranslation(); const { i18n } = useTranslation();
const [author, setAuthor] = useState<any>(null); const [author, setAuthor] = useState<any>(null);
const [plugins, setPlugins] = useState<any[]>([]); const [plugins, setPlugins] = useState<any[]>([]);
const [loading, setLoading] = useState(true); const [loading, setLoading] = useState(true);

View File

@ -1,8 +1,8 @@
import { useState, useEffect, useRef } from 'react'; import { useState, useEffect, useRef } from 'react';
import { Link } from 'react-router-dom';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import api from '../api'; import api from '../api';
import SEO from '../components/SEO'; import SEO from '../components/SEO';
import PluginCard from '../components/PluginCard';
const Home = () => { const Home = () => {
const { t } = useTranslation(); const { t } = useTranslation();

View File

@ -91,7 +91,6 @@ const PluginDetail = () => {
const [lightboxIndex, setLightboxIndex] = useState<number>(0); const [lightboxIndex, setLightboxIndex] = useState<number>(0);
const [selectedLanguage] = useState('en'); const [selectedLanguage] = useState('en');
const [currentDescription, setCurrentDescription] = useState(''); const [currentDescription, setCurrentDescription] = useState('');
const [loading, setLoading] = useState(true);
// Ownership // Ownership
const [ownsPlugin, setOwnsPlugin] = useState(false); const [ownsPlugin, setOwnsPlugin] = useState(false);
@ -133,7 +132,6 @@ const PluginDetail = () => {
const fetchPlugin = () => { const fetchPlugin = () => {
api.get(`/plugins/${id}`).then(res => { api.get(`/plugins/${id}`).then(res => {
setPlugin(res.data); setPlugin(res.data);
setLoading(false);
if (res.data.screenshots?.length > 0) { if (res.data.screenshots?.length > 0) {
setMainScreenshot(res.data.screenshots[0].path); setMainScreenshot(res.data.screenshots[0].path);
} }
@ -251,7 +249,6 @@ const PluginDetail = () => {
// Does not own — go to Stripe checkout // Does not own — go to Stripe checkout
try { try {
setLoading(true);
const res = await api.post(`/plugins/${id}/checkout`); const res = await api.post(`/plugins/${id}/checkout`);
if (res.data.url) window.location.href = res.data.url; if (res.data.url) window.location.href = res.data.url;
} catch (err: any) { } catch (err: any) {
@ -264,7 +261,6 @@ const PluginDetail = () => {
alert('Checkout failed. Please try again.'); alert('Checkout failed. Please try again.');
} }
} finally { } finally {
setLoading(false);
} }
return; return;
} }
@ -587,7 +583,7 @@ const PluginDetail = () => {
) : reviewReportOpen === r.id ? ( ) : reviewReportOpen === r.id ? (
<form onSubmit={(e) => submitReviewReport(e, r.id)} className="report-form" style={{ maxWidth: '400px', width: '100%' }}> <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> <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 => ( {REVIEW_REPORT_REASONS.map(reason => (
<button <button
key={reason} key={reason}

View File

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

View File

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

View File

@ -48,7 +48,7 @@ const DashboardAudience = () => {
</div> </div>
<div className="map-wrapper" style={{ background: '#0f0f1a', borderRadius: '12px', padding: '20px', border: '1px solid var(--border)' }}> <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 geography={GEO_URL}>
{({ geographies }) => {({ geographies }) =>
geographies.map((geo) => { geographies.map((geo) => {

View File

@ -1,4 +1,3 @@
import React from 'react';
import { import {
AreaChart, Area, XAxis, YAxis, Tooltip, ResponsiveContainer, AreaChart, Area, XAxis, YAxis, Tooltip, ResponsiveContainer,
LineChart, Line LineChart, Line
@ -10,12 +9,12 @@ import {
import { useAnalytics } from './useAnalytics'; import { useAnalytics } from './useAnalytics';
// Helper for formatting large numbers // Helper for formatting large numbers
const formatValue = (val) => { const formatValue = (val: number) => {
if (val >= 1000) return `${(val / 1000).toFixed(1)}k`; 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) { if (active && payload && payload.length) {
return ( return (
<div className="custom-tooltip-v2"> <div className="custom-tooltip-v2">
@ -27,7 +26,7 @@ const CustomTooltip = ({ active, payload, label }) => {
return null; return null;
}; };
const MiniChart = ({ data, color, dataKey }) => ( const MiniChart = ({ data, color, dataKey }: any) => (
<div style={{ width: '80px', height: '40px' }}> <div style={{ width: '80px', height: '40px' }}>
<ResponsiveContainer width="100%" height="100%"> <ResponsiveContainer width="100%" height="100%">
<LineChart data={data}> <LineChart data={data}>
@ -44,7 +43,7 @@ const MiniChart = ({ data, color, dataKey }) => (
</div> </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 // Logic Fix: Handle 0% as neutral
const trendValue = parseFloat(comparison) || 0; const trendValue = parseFloat(comparison) || 0;
const isPositive = trendValue > 0; const isPositive = trendValue > 0;
@ -161,7 +160,7 @@ const DashboardOverview = () => {
tick={{fill: '#94a3b8', fontSize: 12}} tick={{fill: '#94a3b8', fontSize: 12}}
tickFormatter={formatValue} tickFormatter={formatValue}
/> />
<Tooltip content={<CustomTooltip />} /> <Tooltip content={<CustomTooltip active={undefined} payload={undefined} label={undefined} />} />
<Area <Area
type="monotone" type="monotone"
dataKey="earnings" dataKey="earnings"
@ -183,7 +182,7 @@ const DashboardOverview = () => {
</div> </div>
<div className="feed-list"> <div className="feed-list">
{recentActivity && recentActivity.length > 0 ? ( {recentActivity && recentActivity.length > 0 ? (
recentActivity.map((activity) => ( recentActivity.map((activity: any) => (
<div key={activity.id} className="feed-item-v2"> <div key={activity.id} className="feed-item-v2">
<div className="feed-avatar"> <div className="feed-avatar">
{activity.userInitials || <User size={14} />} {activity.userInitials || <User size={14} />}

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 { useNavigate } from 'react-router-dom';
import { import {
Globe, ImageIcon, Plus, Search, X, Upload, FileCode, 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 { useNavigate, useParams } from 'react-router-dom';
import api from '../../../api'; import api from '../../../api';
import { import {
LayoutGrid, Tag, Upload, DollarSign, Trash2, LayoutGrid, Tag, Upload, DollarSign, Trash2,
ChevronLeft, Circle Circle
} from 'lucide-react'; } from 'lucide-react';
import StoreListing from './StoreListing'; import StoreListing from './StoreListing';