Ensure useBudget is within BudgetProvider

The useBudget hook was throwing an error when used outside of a BudgetProvider. This commit ensures that the useBudget hook is always used within a BudgetProvider to prevent this error.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-15 16:32:07 +00:00
parent 2fa7423071
commit 1136683b57
2 changed files with 51 additions and 57 deletions

View File

@@ -19,6 +19,7 @@ import ForgotPassword from './pages/ForgotPassword';
import Analytics from './pages/Analytics';
import PaymentMethods from './pages/PaymentMethods';
import Settings from './pages/Settings';
import { BudgetProvider } from './contexts/BudgetContext';
// 전역 오류 핸들러
const handleError = (error: any) => {
@@ -74,30 +75,32 @@ function App() {
return (
<ErrorBoundary>
<AuthContextWrapper>
<Router>
<div className="flex flex-col min-h-screen">
<NavBar />
<div className="flex-grow">
<Routes>
<Route path="/" element={<Index />} />
<Route path="/login" element={<Login />} />
<Route path="/register" element={<Register />} />
<Route path="/profile" element={<ProfileManagement />} />
<Route path="/settings" element={<Settings />} />
<Route path="/supabase-settings" element={<SupabaseSettings />} />
<Route path="/transactions" element={<Transactions />} />
<Route path="/security-privacy" element={<SecurityPrivacySettings />} />
<Route path="/notifications" element={<NotificationSettings />} />
<Route path="/help-support" element={<HelpSupport />} />
<Route path="/forgot-password" element={<ForgotPassword />} />
<Route path="/analytics" element={<Analytics />} />
<Route path="/payment-methods" element={<PaymentMethods />} />
<Route path="*" element={<NotFound />} />
</Routes>
<BudgetProvider>
<Router>
<div className="flex flex-col min-h-screen">
<NavBar />
<div className="flex-grow">
<Routes>
<Route path="/" element={<Index />} />
<Route path="/login" element={<Login />} />
<Route path="/register" element={<Register />} />
<Route path="/profile" element={<ProfileManagement />} />
<Route path="/settings" element={<Settings />} />
<Route path="/supabase-settings" element={<SupabaseSettings />} />
<Route path="/transactions" element={<Transactions />} />
<Route path="/security-privacy" element={<SecurityPrivacySettings />} />
<Route path="/notifications" element={<NotificationSettings />} />
<Route path="/help-support" element={<HelpSupport />} />
<Route path="/forgot-password" element={<ForgotPassword />} />
<Route path="/analytics" element={<Analytics />} />
<Route path="/payment-methods" element={<PaymentMethods />} />
<Route path="*" element={<NotFound />} />
</Routes>
</div>
<Toaster />
</div>
<Toaster />
</div>
</Router>
</Router>
</BudgetProvider>
</AuthContextWrapper>
</ErrorBoundary>
);