This commit is contained in:
Iliyan Angelov
2025-11-23 18:59:18 +02:00
parent be07802066
commit 627959f52b
1840 changed files with 236564 additions and 3475 deletions

View File

@@ -12,14 +12,16 @@ import { CookieConsentProvider } from './contexts/CookieConsentContext';
import { CurrencyProvider } from './contexts/CurrencyContext';
import { CompanySettingsProvider } from './contexts/CompanySettingsContext';
import { AuthModalProvider } from './contexts/AuthModalContext';
import { NavigationLoadingProvider, useNavigationLoading } from './contexts/NavigationLoadingContext';
import OfflineIndicator from './components/common/OfflineIndicator';
import CookieConsentBanner from './components/common/CookieConsentBanner';
import CookiePreferencesModal from './components/common/CookiePreferencesModal';
import AnalyticsLoader from './components/common/AnalyticsLoader';
import Loading from './components/common/Loading';
import Preloader from './components/common/Preloader';
import ScrollToTop from './components/common/ScrollToTop';
import AuthModalManager from './components/modals/AuthModalManager';
import ResetPasswordRouteHandler from './components/ResetPasswordRouteHandler';
import ResetPasswordRouteHandler from './components/auth/ResetPasswordRouteHandler';
import useAuthStore from './store/useAuthStore';
import useFavoritesStore from './store/useFavoritesStore';
@@ -49,9 +51,11 @@ const PaymentConfirmationPage = lazy(() => import('./pages/customer/PaymentConfi
const PaymentResultPage = lazy(() => import('./pages/customer/PaymentResultPage'));
const PayPalReturnPage = lazy(() => import('./pages/customer/PayPalReturnPage'));
const PayPalCancelPage = lazy(() => import('./pages/customer/PayPalCancelPage'));
const BoricaReturnPage = lazy(() => import('./pages/customer/BoricaReturnPage'));
const InvoicePage = lazy(() => import('./pages/customer/InvoicePage'));
const ProfilePage = lazy(() => import('./pages/customer/ProfilePage'));
const LoyaltyPage = lazy(() => import('./pages/customer/LoyaltyPage'));
const GroupBookingPage = lazy(() => import('./pages/customer/GroupBookingPage'));
const AboutPage = lazy(() => import('./pages/AboutPage'));
const ContactPage = lazy(() => import('./pages/ContactPage'));
const PrivacyPolicyPage = lazy(() => import('./pages/PrivacyPolicyPage'));
@@ -67,22 +71,47 @@ const PaymentManagementPage = lazy(() => import('./pages/admin/PaymentManagement
const UserManagementPage = lazy(() => import('./pages/admin/UserManagementPage'));
const GuestProfilePage = lazy(() => import('./pages/admin/GuestProfilePage'));
const BookingManagementPage = lazy(() => import('./pages/admin/BookingManagementPage'));
const GroupBookingManagementPage = lazy(() => import('./pages/admin/GroupBookingManagementPage'));
const PageContentDashboardPage = lazy(() => import('./pages/admin/PageContentDashboard'));
const AnalyticsDashboardPage = lazy(() => import('./pages/admin/AnalyticsDashboardPage'));
const BusinessDashboardPage = lazy(() => import('./pages/admin/BusinessDashboardPage'));
const SettingsPage = lazy(() => import('./pages/admin/SettingsPage'));
const TaskManagementPage = lazy(() => import('./pages/admin/TaskManagementPage'));
const WorkflowManagementPage = lazy(() => import('./pages/admin/WorkflowManagementPage'));
const NotificationManagementPage = lazy(() => import('./pages/admin/NotificationManagementPage'));
const ReceptionDashboardPage = lazy(() => import('./pages/admin/ReceptionDashboardPage'));
const LoyaltyManagementPage = lazy(() => import('./pages/admin/LoyaltyManagementPage'));
const AdvancedRoomManagementPage = lazy(() => import('./pages/admin/AdvancedRoomManagementPage'));
const RatePlanManagementPage = lazy(() => import('./pages/admin/RatePlanManagementPage'));
const PackageManagementPage = lazy(() => import('./pages/admin/PackageManagementPage'));
const SecurityManagementPage = lazy(() => import('./pages/admin/SecurityManagementPage'));
const EmailCampaignManagementPage = lazy(() => import('./pages/admin/EmailCampaignManagementPage'));
const StaffDashboardPage = lazy(() => import('./pages/staff/DashboardPage'));
const StaffBookingManagementPage = lazy(() => import('./pages/staff/BookingManagementPage'));
const StaffReceptionDashboardPage = lazy(() => import('./pages/staff/ReceptionDashboardPage'));
const StaffPaymentManagementPage = lazy(() => import('./pages/staff/PaymentManagementPage'));
const StaffAnalyticsDashboardPage = lazy(() => import('./pages/staff/AnalyticsDashboardPage'));
const StaffLoyaltyManagementPage = lazy(() => import('./pages/staff/LoyaltyManagementPage'));
const StaffGuestProfilePage = lazy(() => import('./pages/staff/GuestProfilePage'));
const StaffAdvancedRoomManagementPage = lazy(() => import('./pages/staff/AdvancedRoomManagementPage'));
const ChatManagementPage = lazy(() => import('./pages/staff/ChatManagementPage'));
const StaffLayout = lazy(() => import('./pages/StaffLayout'));
const AccountantDashboardPage = lazy(() => import('./pages/accountant/DashboardPage'));
const AccountantPaymentManagementPage = lazy(() => import('./pages/accountant/PaymentManagementPage'));
const AccountantInvoiceManagementPage = lazy(() => import('./pages/accountant/InvoiceManagementPage'));
const AccountantAnalyticsDashboardPage = lazy(() => import('./pages/accountant/AnalyticsDashboardPage'));
const AccountantLayout = lazy(() => import('./pages/AccountantLayout'));
const NotFoundPage = lazy(() => import('./pages/NotFoundPage'));
// Wrapper component to use navigation loading hook inside CompanySettingsProvider
const PreloaderWrapper: React.FC = () => {
const { isLoading } = useNavigationLoading();
return <Preloader isLoading={isLoading} />;
};
function App() {
const {
@@ -138,8 +167,10 @@ function App() {
v7_relativeSplatPath: true,
}}
>
<ScrollToTop />
<Suspense fallback={<Loading fullScreen text="Loading page..." />}>
<NavigationLoadingProvider>
<PreloaderWrapper />
<ScrollToTop />
<Suspense fallback={<Loading fullScreen text="Loading page..." />}>
<Routes>
{}
<Route
@@ -185,6 +216,10 @@ function App() {
path="payment/paypal/cancel"
element={<PayPalCancelPage />}
/>
<Route
path="payment/borica/return"
element={<BoricaReturnPage />}
/>
<Route
path="invoices/:id"
element={
@@ -291,6 +326,14 @@ function App() {
</CustomerRoute>
}
/>
<Route
path="group-bookings"
element={
<CustomerRoute>
<GroupBookingPage />
</CustomerRoute>
}
/>
</Route>
{}
@@ -325,6 +368,10 @@ function App() {
path="reception"
element={<ReceptionDashboardPage />}
/>
<Route
path="advanced-rooms"
element={<AdvancedRoomManagementPage />}
/>
<Route
path="page-content"
element={<PageContentDashboardPage />}
@@ -333,6 +380,18 @@ function App() {
path="analytics"
element={<AnalyticsDashboardPage />}
/>
<Route
path="tasks"
element={<TaskManagementPage />}
/>
<Route
path="workflows"
element={<WorkflowManagementPage />}
/>
<Route
path="notifications"
element={<NotificationManagementPage />}
/>
<Route
path="settings"
element={<SettingsPage />}
@@ -357,6 +416,26 @@ function App() {
path="guest-profiles"
element={<GuestProfilePage />}
/>
<Route
path="group-bookings"
element={<GroupBookingManagementPage />}
/>
<Route
path="rate-plans"
element={<RatePlanManagementPage />}
/>
<Route
path="packages"
element={<PackageManagementPage />}
/>
<Route
path="security"
element={<SecurityManagementPage />}
/>
<Route
path="email-campaigns"
element={<EmailCampaignManagementPage />}
/>
</Route>
{}
@@ -375,19 +454,19 @@ function App() {
<Route path="dashboard" element={<StaffDashboardPage />} />
<Route
path="bookings"
element={<BookingManagementPage />}
element={<StaffBookingManagementPage />}
/>
<Route
path="reception"
element={<ReceptionDashboardPage />}
element={<StaffReceptionDashboardPage />}
/>
<Route
path="payments"
element={<PaymentManagementPage />}
element={<StaffPaymentManagementPage />}
/>
<Route
path="reports"
element={<AnalyticsDashboardPage />}
element={<StaffAnalyticsDashboardPage />}
/>
<Route
path="chats"
@@ -395,11 +474,15 @@ function App() {
/>
<Route
path="loyalty"
element={<LoyaltyManagementPage />}
element={<StaffLoyaltyManagementPage />}
/>
<Route
path="guest-profiles"
element={<GuestProfilePage />}
element={<StaffGuestProfilePage />}
/>
<Route
path="advanced-rooms"
element={<StaffAdvancedRoomManagementPage />}
/>
</Route>
@@ -419,15 +502,15 @@ function App() {
<Route path="dashboard" element={<AccountantDashboardPage />} />
<Route
path="payments"
element={<PaymentManagementPage />}
element={<AccountantPaymentManagementPage />}
/>
<Route
path="invoices"
element={<InvoiceManagementPage />}
element={<AccountantInvoiceManagementPage />}
/>
<Route
path="reports"
element={<AnalyticsDashboardPage />}
element={<AccountantAnalyticsDashboardPage />}
/>
</Route>
@@ -458,6 +541,7 @@ function App() {
<AnalyticsLoader />
<AuthModalManager />
</Suspense>
</NavigationLoadingProvider>
</BrowserRouter>
</AuthModalProvider>
</CompanySettingsProvider>