Add EventsContext for managing events state and operations

Introduce an EventsContext and EventsProvider to centralize event-related logic, including queries, mutations, and pagination. Wrap the application with the EventsProvider in the providers index to make the context accessible throughout the app.
This commit is contained in:
2025-03-11 06:19:06 +01:00
parent 114f0e7807
commit 80ff350053
2 changed files with 264 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ import React from "react";
import { QueryClientProvider, QueryClient } from "@tanstack/react-query";
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
import { AuthProvider } from "@/context/auth-context";
import { EventsProvider } from "@/context/event-context";
import { ThemeProvider } from "next-themes";
// Create a client
@@ -26,7 +27,9 @@ export function Providers({ children }: { children: React.ReactNode }) {
enableSystem
disableTransitionOnChange
>
<AuthProvider>{children}</AuthProvider>
<AuthProvider>
<EventsProvider>{children}</EventsProvider>
</AuthProvider>
</ThemeProvider>
<ReactQueryDevtools initialIsOpen={false} />
</QueryClientProvider>