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`.
53 lines
2.1 KiB
TypeScript
53 lines
2.1 KiB
TypeScript
|
|
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';
|
|
import Register from './pages/Register';
|
|
import Settings from './pages/Settings';
|
|
import Transactions from './pages/Transactions';
|
|
import Analytics from './pages/Analytics';
|
|
import ProfileManagement from './pages/ProfileManagement';
|
|
import NotFound from './pages/NotFound';
|
|
import PaymentMethods from './pages/PaymentMethods';
|
|
import HelpSupport from './pages/HelpSupport';
|
|
import SecurityPrivacySettings from './pages/SecurityPrivacySettings';
|
|
import NotificationSettings from './pages/NotificationSettings';
|
|
import ForgotPassword from './pages/ForgotPassword';
|
|
|
|
function App() {
|
|
useEffect(() => {
|
|
document.title = "적자 탈출 가계부";
|
|
}, []);
|
|
|
|
return (
|
|
<AuthProvider>
|
|
<BudgetProvider>
|
|
<div className="App">
|
|
<Routes>
|
|
<Route path="/" element={<Index />} />
|
|
<Route path="/login" element={<Login />} />
|
|
<Route path="/register" element={<Register />} />
|
|
<Route path="/settings" element={<Settings />} />
|
|
<Route path="/transactions" element={<Transactions />} />
|
|
<Route path="/analytics" element={<Analytics />} />
|
|
<Route path="/profile" element={<ProfileManagement />} />
|
|
<Route path="/payment-methods" element={<PaymentMethods />} />
|
|
<Route path="/help-support" element={<HelpSupport />} />
|
|
<Route path="/security-privacy" element={<SecurityPrivacySettings />} />
|
|
<Route path="/notifications" element={<NotificationSettings />} />
|
|
<Route path="/forgot-password" element={<ForgotPassword />} />
|
|
<Route path="*" element={<NotFound />} />
|
|
</Routes>
|
|
<Toaster />
|
|
</div>
|
|
</BudgetProvider>
|
|
</AuthProvider>
|
|
);
|
|
}
|
|
|
|
export default App;
|