Skip to content

Commit

Permalink
Forward refs through WindowCanvasNavigationControls.
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Nov 21, 2024
1 parent 0947591 commit aa680d8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/components/WindowCanvasNavigationControls.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { forwardRef } from 'react';
import PropTypes from 'prop-types';
import { alpha, styled } from '@mui/material/styles';
import classNames from 'classnames';
Expand Down Expand Up @@ -30,10 +31,10 @@ const Root = styled(Paper, { name: 'WindowCanvasNavigationControls', slot: 'root
/**
* Represents the viewer controls in the mirador workspace.
*/
export function WindowCanvasNavigationControls({
export const WindowCanvasNavigationControls = forwardRef(({
showZoomControls = false, size, visible = true, windowId, zoomToWorld,
}) {
const pluginProps = arguments[0]; // eslint-disable-line prefer-rest-params
}, ref) => {
const pluginProps = { showZoomControls, size, visible, windowId };

Check failure on line 37 in src/components/WindowCanvasNavigationControls.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Expected a line break after this opening brace

Check failure on line 37 in src/components/WindowCanvasNavigationControls.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Expected a line break before this closing brace

Check failure on line 37 in src/components/WindowCanvasNavigationControls.js

View workflow job for this annotation

GitHub Actions / build (20.x)

Expected a line break after this opening brace

Check failure on line 37 in src/components/WindowCanvasNavigationControls.js

View workflow job for this annotation

GitHub Actions / build (20.x)

Expected a line break before this closing brace
/**
* Determine if canvasNavControls are stacked (based on a hard-coded width)
*/
Expand All @@ -51,6 +52,7 @@ export function WindowCanvasNavigationControls({
)
}
elevation={0}
ref={ref}
>
<Stack
direction={canvasNavControlsAreStacked ? 'column' : 'row'}
Expand All @@ -65,7 +67,7 @@ export function WindowCanvasNavigationControls({
<PluginHook {...pluginProps} />
</Root>
);
}
});

WindowCanvasNavigationControls.propTypes = {
showZoomControls: PropTypes.bool,

Check failure on line 73 in src/components/WindowCanvasNavigationControls.js

View workflow job for this annotation

GitHub Actions / build (18.x)

propType "showZoomControls" is not required, but has no corresponding defaultProps declaration

Check failure on line 73 in src/components/WindowCanvasNavigationControls.js

View workflow job for this annotation

GitHub Actions / build (20.x)

propType "showZoomControls" is not required, but has no corresponding defaultProps declaration
Expand Down

0 comments on commit aa680d8

Please sign in to comment.