From 22aae75d1394680412f25b258dc9bf4b459135f1 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sat, 22 Mar 2025 07:30:45 +0000 Subject: [PATCH] Fix: Wrap components with AuthProvider The `useAuth` hook was being called outside of the `AuthProvider`, leading to an error. This commit ensures that all components using `useAuth` are wrapped within the `AuthProvider`. --- src/App.tsx | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 750a6ec..8313301 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2,6 +2,7 @@ import React, { useEffect } from 'react'; import { Routes, Route } from 'react-router-dom'; import { BudgetProvider } from './contexts/budget/BudgetContext'; +import { AuthProvider } from './contexts/auth/AuthProvider'; import { Toaster } from './components/ui/toaster'; import Index from './pages/Index'; import Login from './pages/Login'; @@ -23,26 +24,28 @@ function App() { }, []); return ( - -
- - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - - -
-
+ + +
+ + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + + +
+
+
); }