Skip to content

Commit

Permalink
fix ArrowNavView visibility control issue
Browse files Browse the repository at this point in the history
  • Loading branch information
imanjra committed Aug 13, 2024
1 parent d45dcbd commit da67848
Showing 1 changed file with 28 additions and 18 deletions.
46 changes: 28 additions & 18 deletions app/packages/core/src/plugins/SchemaIO/components/ArrowNavView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<>
<Arrow
style={positionBasedStyleBackward[position]}
onClick={() => {
handleClick(panelId, { operator: on_backward });
}}
>
<LookerArrowLeftIcon />
</Arrow>
<Arrow
isRight
style={positionBasedStyleForward[position]}
onClick={() => {
handleClick(panelId, { operator: on_forward });
}}
>
<LookerArrowRightIcon />
</Arrow>
{backward && (
<Arrow
style={positionBasedStyleBackward[position]}
onClick={() => {
handleClick(panelId, { operator: on_backward });
}}
>
<LookerArrowLeftIcon />
</Arrow>
)}
{forward && (
<Arrow
isRight
style={positionBasedStyleForward[position]}
onClick={() => {
handleClick(panelId, { operator: on_forward });
}}
>
<LookerArrowRightIcon />
</Arrow>
)}
</>
);
}
Expand Down

0 comments on commit da67848

Please sign in to comment.