diff --git a/eslint.config.js b/eslint.config.js index b19330b1..e7f7808f 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -20,4 +20,10 @@ export default defineConfig([ globals: globals.browser, }, }, + { + files: ['**/context/**/*.{ts,tsx}'], + rules: { + 'react-refresh/only-export-components': 'off', + }, + }, ]) diff --git a/src/components/CreateCommunity.tsx b/src/components/CreateCommunity.tsx index c4af7ae0..3a83a19b 100644 --- a/src/components/CreateCommunity.tsx +++ b/src/components/CreateCommunity.tsx @@ -2,8 +2,7 @@ import { useMutation, useQueryClient } from "@tanstack/react-query"; import { useState } from "react"; import { useNavigate } from "react-router-dom"; import { supabase } from "../supabase-client"; -import { AlertCircle, CheckCircle } from "lucide-react"; -import {showSuccess, showError} from '../utils/toast'; +import { showSuccess } from '../utils/toast'; interface CommunityInput { name: string; @@ -26,7 +25,7 @@ export const CreateCommunity = () => { const navigate = useNavigate(); const queryClient = useQueryClient(); - const { mutate, isPending, isError, error, isSuccess } = useMutation({ + const { mutate, isPending, isSuccess } = useMutation({ mutationFn: createCommunity, onSuccess: () => { diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx index 77965f96..f41cec03 100644 --- a/src/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -1,11 +1,11 @@ import { Link } from "react-router-dom"; import { - Code2, Github, Mail, Heart, Twitter, Linkedin, MessageCircle, - Send, Zap, Cpu, Shield, Cloud, Database, Code, - TrendingUp, Calendar, ShieldCheck, CpuIcon, RadioTower, MessageSquare, - Users, Users2, Server, Globe, CheckCircle, X, Sparkles, Rocket, - Activity, Clock, Wifi, Terminal, Layers, ChevronUp, Home, - Users as UsersIcon, Plus, User, LogIn, UserPlus, GitMerge, + Code2, Github, Mail, Heart, Linkedin, MessageCircle, + Send, Zap, Shield, Cloud, Database, + Calendar, CpuIcon, RadioTower, MessageSquare, + Users2, Server, CheckCircle, X, Sparkles, Rocket, + ChevronUp, Home, + Users as UsersIcon, Plus, User, GitMerge, Sun, Moon } from "lucide-react"; import { useState, useEffect } from "react"; diff --git a/src/components/MessagingInterface.tsx b/src/components/MessagingInterface.tsx index 283a4d45..c273d47f 100644 --- a/src/components/MessagingInterface.tsx +++ b/src/components/MessagingInterface.tsx @@ -8,7 +8,6 @@ import MessageInput from './MessageInput'; import ConversationHeader from './ConversationHeader'; import CreateConversationModal from './CreateConversationModal'; import type { Conversation } from '../types/messaging'; -import { showError } from '../utils/toast'; const MessagingInterface = () => { const { user } = useAuth(); diff --git a/src/context/AuthContext.tsx b/src/context/AuthContext.tsx index c8c664d6..13219378 100644 --- a/src/context/AuthContext.tsx +++ b/src/context/AuthContext.tsx @@ -1,4 +1,4 @@ -/* eslint-disable react-refresh/only-export-components */ + import { createContext, useEffect, useState } from "react"; import { type User, AuthError } from "@supabase/supabase-js"; import { supabase, isBackendAvailable } from "../supabase-client"; diff --git a/src/hooks/useEvents.ts b/src/hooks/useEvents.ts index 071351ef..49e7908c 100644 --- a/src/hooks/useEvents.ts +++ b/src/hooks/useEvents.ts @@ -1,7 +1,7 @@ import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'; import { supabase, isBackendAvailable } from '../supabase-client'; import { useAuth } from './useAuth'; -import type { Event, EventWithDetails, CreateEventData, EventFilters, EventAttendee } from '../types/events'; +import type { EventWithDetails, CreateEventData, EventFilters } from '../types/events'; import { mockEvents } from '../utils/mockEvents'; export const useEvents = (filters?: EventFilters) => { @@ -177,7 +177,7 @@ export const useCreateEvent = () => { }; // Update the query cache - queryClient.setQueryData(['events'], (old: any) => { + queryClient.setQueryData(['events'], (old: EventWithDetails[] | undefined) => { if (Array.isArray(old)) { return [newEvent, ...old]; } diff --git a/src/pages/CreateEventPage.tsx b/src/pages/CreateEventPage.tsx index 7fd87019..bb0798fb 100644 --- a/src/pages/CreateEventPage.tsx +++ b/src/pages/CreateEventPage.tsx @@ -49,7 +49,7 @@ export default function CreateEventPage() { showSuccess('Event created successfully!'); navigate(`/events/${data.id}`); }, - onError: (error: any) => { + onError: (error: Error) => { showError(error.message || 'Failed to create event'); } }); @@ -63,13 +63,6 @@ export default function CreateEventPage() { })); } - const handleVirtualToggle = () => { - setFormData(prev => ({ - ...prev, - is_virtual: !prev.is_virtual - })); - } - const handleCheckboxChange = (e: React.ChangeEvent) => { const { name } = e.target; setFormData(prev => ({ diff --git a/src/pages/DashboardPage.tsx b/src/pages/DashboardPage.tsx index 09638462..05dd576f 100644 --- a/src/pages/DashboardPage.tsx +++ b/src/pages/DashboardPage.tsx @@ -9,7 +9,6 @@ import { Code2, Plus, Activity, - User, MessageCircle, ThumbsUp, Settings, @@ -84,7 +83,7 @@ export default function DashboardPage() { }); // Fetch User Posts - const { data: myPosts, isLoading: postsLoading } = useQuery({ + const { data: myPosts } = useQuery({ queryKey: ['my-posts', user?.id], queryFn: async () => { if (!user || !supabase) return []; @@ -100,7 +99,7 @@ export default function DashboardPage() { }); // Fetch Joined Communities - const { data: myCommunities, isLoading: communitiesLoading } = useQuery({ + const { data: myCommunities } = useQuery({ queryKey: ['my-communities', user?.id], queryFn: async () => { if (!user || !supabase) return []; @@ -115,7 +114,7 @@ export default function DashboardPage() { }); // Fetch Created Communities - const { data: createdCommunities, isLoading: createdCommLoading } = useQuery({ + const { data: createdCommunities } = useQuery({ queryKey: ['created-communities', user?.id], queryFn: async () => { if (!user || !supabase) return []; @@ -131,7 +130,7 @@ export default function DashboardPage() { }); // Fetch Joined Events - const { data: myEvents, isLoading: eventsLoading } = useQuery({ + const { data: myEvents } = useQuery({ queryKey: ['my-events', user?.id], queryFn: async () => { if (!user || !supabase) return []; @@ -145,11 +144,6 @@ export default function DashboardPage() { enabled: !!user && (activeTab === 'events' || activeTab === 'overview') }); - const isLoading = statsLoading || - (activeTab === 'posts' && postsLoading) || - (activeTab === 'communities' && (communitiesLoading || createdCommLoading)) || - (activeTab === 'events' && eventsLoading); - return (
{/* Dynamic Header */} @@ -205,7 +199,7 @@ export default function DashboardPage() { ].map((tab) => (