-
+export const Sidebar = () => {
+ const { breakpoint } = useSidebarBreakpointContext();
+
+ if (breakpoint === "wide") {
+ return (
+ <>
+
+
+
-
-
-
-
-
-
- >
-);
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+ );
+ }
+
+ return (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+ );
+};
diff --git a/src/components/Sidebar/SidebarContext.tsx b/src/components/Sidebar/SidebarContext.tsx
new file mode 100644
index 00000000000..83ee58339b2
--- /dev/null
+++ b/src/components/Sidebar/SidebarContext.tsx
@@ -0,0 +1,56 @@
+import { createContext, ReactNode, useContext, useEffect, useState } from "react";
+
+type SidebarBreakpoint = "default" | "wide";
+
+interface SidebarContextValue {
+ breakpoint: SidebarBreakpoint;
+ setBreakpoint: (breakpoint: SidebarBreakpoint) => void;
+}
+
+const SidebarContext = createContext(undefined);
+
+export const SidebarProvider = ({ children }: { children: ReactNode }) => {
+ const [breakpoint, setBreakpoint] = useState("default");
+
+ return (
+
+ {children}
+
+ );
+};
+
+export const useSidebarBreakpointContext = () => {
+ const context = useContext(SidebarContext);
+
+ if (context === undefined) {
+ throw new Error("useSidebarBreakpoint must be used within a SidebarProvider");
+ }
+
+ return context;
+};
+
+/**
+ * Hook to set a custom sidebar breakpoint for a page.
+ * The breakpoint is automatically reset to "default" when the component unmounts.
+ *
+ * @param breakpoint - The breakpoint to use ("default" or "wide")
+ *
+ * @example
+ * ```tsx
+ * const MyPage = () => {
+ * useCustomSidebarBreakpoint("wide");
+ * return Page content
;
+ * };
+ * ```
+ */
+export const useCustomSidebarBreakpoint = (breakpoint: SidebarBreakpoint) => {
+ const { setBreakpoint } = useSidebarBreakpointContext();
+
+ useEffect(() => {
+ setBreakpoint(breakpoint);
+
+ return () => {
+ setBreakpoint("default");
+ };
+ }, [breakpoint, setBreakpoint]);
+};
diff --git a/src/orders/components/OrderManualTransactionRefundPage/OrderManualTransactionRefundPage.tsx b/src/orders/components/OrderManualTransactionRefundPage/OrderManualTransactionRefundPage.tsx
index 994f027e3c6..320df7010bc 100644
--- a/src/orders/components/OrderManualTransactionRefundPage/OrderManualTransactionRefundPage.tsx
+++ b/src/orders/components/OrderManualTransactionRefundPage/OrderManualTransactionRefundPage.tsx
@@ -184,7 +184,7 @@ export const OrderManualTransactionRefundPage = ({
-
+
diff --git a/src/orders/components/OrderTransactionRefundPage/OrderTransactionRefundPage.tsx b/src/orders/components/OrderTransactionRefundPage/OrderTransactionRefundPage.tsx
index 89314ba35a7..86ccb61f8a2 100644
--- a/src/orders/components/OrderTransactionRefundPage/OrderTransactionRefundPage.tsx
+++ b/src/orders/components/OrderTransactionRefundPage/OrderTransactionRefundPage.tsx
@@ -6,6 +6,7 @@ import Link from "@dashboard/components/Link";
import { Pill } from "@dashboard/components/Pill";
import { hasPermissions } from "@dashboard/components/RequirePermissions";
import { Savebar } from "@dashboard/components/Savebar";
+import { useCustomSidebarBreakpoint } from "@dashboard/components/Sidebar/SidebarContext";
import {
OrderDetailsGrantRefundFragment,
PermissionEnum,
@@ -145,6 +146,9 @@ const OrderTransactionRefundPage = ({
const navigate = useNavigator();
const intl = useIntl();
+ // Use wider breakpoint to show minimal sidebar and give more horizontal space for the transaction table
+ useCustomSidebarBreakpoint("wide");
+
const [editedRefundLineIndex, setEditedRefundLineIndex] = useState