PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.9
Yatra – Travel Booking & Tour Operator Software v3.0.9
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.9, at resources/js/account-page.tsx

65 lines 1.9 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 { ErrorBoundary } from "./components/ErrorBoundary";
12 import { __ } from "./lib/i18n";
13 import "./css/index.css";
14
15 // Create React Query client
16 const queryClient = new QueryClient({
17 defaultOptions: {
18 queries: {
19 refetchOnWindowFocus: false,
20 retry: 1,
21 staleTime: 5 * 60 * 1000, // 5 minutes
22 },
23 },
24 });
25
26 // Get mount point
27 const rootElement = document.getElementById("yatra-account-page-root");
28
29 if (rootElement) {
30 // Opt out of browser auto-translation so it never rewrites React-managed
31 // text nodes (which otherwise causes "removeChild" reconciliation crashes).
32 rootElement.setAttribute("translate", "no");
33 rootElement.classList.add("notranslate");
34
35 try {
36 const root = ReactDOM.createRoot(rootElement);
37
38 root.render(
39 <React.StrictMode>
40 <QueryClientProvider client={queryClient}>
41 <ToastProvider>
42 <ErrorBoundary>
43 <AccountPage />
44 </ErrorBoundary>
45 </ToastProvider>
46 </QueryClientProvider>
47 </React.StrictMode>,
48 );
49 } catch (error) {
50 console.error("Error rendering account page:", error);
51 const wrap = document.createElement("div");
52 wrap.style.cssText = "padding: 40px; text-align: center;";
53 const h2 = document.createElement("h2");
54 h2.textContent = __("Error loading account page", "yatra");
55 const p = document.createElement("p");
56 p.textContent = __(
57 "Please refresh the page or contact support if the problem continues.",
58 "yatra",
59 );
60 wrap.appendChild(h2);
61 wrap.appendChild(p);
62 rootElement.replaceChildren(wrap);
63 }
64 }
65