Skip to content

Commit

Permalink
Add canvasId as parameter of handleCanvasLabel
Browse files Browse the repository at this point in the history
  • Loading branch information
morpheus-87 committed Feb 9, 2024
1 parent 540381e commit 57b4be8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [Unreleased]

### Added

- Added `canvasId` as parameter of `handleCanvasLabel`

## [0.2.0](https://github.com/dbmdz/mirador-canvasnavigation/releases/tag/0.2.0) - 2024-01-26

### Added
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ The available settings are:
Receives this information about the current window:
```
{
canvasId: ...,
canvasLabel: ...,
currentCanvasIndex: ...,
manifestId: ...,
Expand Down
3 changes: 3 additions & 0 deletions src/components/WindowCanvasNavigationControls.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ const useStyles = makeStyles((theme) => ({
}));

const WindowCanvasNavigationControls = ({
canvasId,
canvasLabel,
config: { handleCanvasLabel = (lbl) => lbl },
currentCanvasIndex,
Expand Down Expand Up @@ -141,6 +142,7 @@ const WindowCanvasNavigationControls = ({
setPendingCanvasIdx(undefined);
};
const canvasLbl = handleCanvasLabel({
canvasId,
canvasLabel,
currentCanvasIndex,
manifestId,
Expand Down Expand Up @@ -245,6 +247,7 @@ const WindowCanvasNavigationControls = ({
};

WindowCanvasNavigationControls.propTypes = {
canvasId: PropTypes.string.isRequired,
canvasLabel: PropTypes.string.isRequired,
config: PropTypes.shape({
handleCanvasLabel: PropTypes.func,
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export default [
const canvases = getCanvases(state, { windowId });
const canvasId = (getCurrentCanvas(state, { windowId }) || {}).id;
return {
canvasId,
canvasLabel: getCanvasLabel(state, {
canvasId,
windowId,
Expand Down

0 comments on commit 57b4be8

Please sign in to comment.