From da67848ea1458344ac5a8e3248ac6fbd4d3bae74 Mon Sep 17 00:00:00 2001 From: imanjra Date: Mon, 12 Aug 2024 19:22:48 -0400 Subject: [PATCH] fix ArrowNavView visibility control issue --- .../SchemaIO/components/ArrowNavView.tsx | 46 +++++++++++-------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/app/packages/core/src/plugins/SchemaIO/components/ArrowNavView.tsx b/app/packages/core/src/plugins/SchemaIO/components/ArrowNavView.tsx index dbbdc8e3f7..daa855ced1 100644 --- a/app/packages/core/src/plugins/SchemaIO/components/ArrowNavView.tsx +++ b/app/packages/core/src/plugins/SchemaIO/components/ArrowNavView.tsx @@ -11,29 +11,39 @@ import { ViewPropsType } from "../utils/types"; export default function ArrowNavView(props: ViewPropsType) { const { schema } = props; const { view = {} } = schema; - const { on_backward, on_forward, position = "center" } = view; + const { + on_backward, + on_forward, + position = "center", + forward = true, + backward = true, + } = view; const panelId = usePanelId(); const handleClick = usePanelEvent(); return ( <> - { - handleClick(panelId, { operator: on_backward }); - }} - > - - - { - handleClick(panelId, { operator: on_forward }); - }} - > - - + {backward && ( + { + handleClick(panelId, { operator: on_backward }); + }} + > + + + )} + {forward && ( + { + handleClick(panelId, { operator: on_forward }); + }} + > + + + )} ); }