PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.5
Yatra – Travel Booking & Tour Operator Software v3.0.5
3.0.16 3.0.15 3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 2.0.1 All 84 releases
yatra / resources / js / account-page.tsx

account-page.tsx in Yatra – Travel Booking & Tour Operator Software 3.0.5, at resources/js/account-page.tsx

57 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * Frontend Account Page Entry Point
3 * Loads the customer account page on the frontend
4 */
5
6 import React from "react";
7 import ReactDOM from "react-dom/client";
8 import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
9 import AccountPage from "./pages/AccountPage";
10 import { ToastProvider } from "./components/ui/toast";
11 import { __ } from "./lib/i18n";
12 import "./css/index.css";
13
14 // Create React Query client
15 const queryClient = new QueryClient({
16 defaultOptions: {
17 queries: {
18 refetchOnWindowFocus: false,
19 retry: 1,
20 staleTime: 5 * 60 * 1000, // 5 minutes
21 },
22 },
23 });
24
25 // Get mount point
26 const rootElement = document.getElementById("yatra-account-page-root");
27
28 if (rootElement) {
29 try {
30 const root = ReactDOM.createRoot(rootElement);
31
32 root.render(
33 <React.StrictMode>
34 <QueryClientProvider client={queryClient}>
35 <ToastProvider>
36 <AccountPage />
37 </ToastProvider>
38 </QueryClientProvider>
39 </React.StrictMode>,
40 );
41 } catch (error) {
42 console.error("Error rendering account page:", error);
43 const wrap = document.createElement("div");
44 wrap.style.cssText = "padding: 40px; text-align: center;";
45 const h2 = document.createElement("h2");
46 h2.textContent = __("Error loading account page", "yatra");
47 const p = document.createElement("p");
48 p.textContent = __(
49 "Please refresh the page or contact support if the problem continues.",
50 "yatra",
51 );
52 wrap.appendChild(h2);
53 wrap.appendChild(p);
54 rootElement.replaceChildren(wrap);
55 }
56 }
57