diff --git a/__tests__/src/components/CompanionWindowFactory.test.js b/__tests__/src/components/CompanionWindowFactory.test.js
index 1d25c8970d..036783d4c6 100644
--- a/__tests__/src/components/CompanionWindowFactory.test.js
+++ b/__tests__/src/components/CompanionWindowFactory.test.js
@@ -6,12 +6,11 @@ import { CompanionWindowFactory } from '../../../src/components/CompanionWindowF
function createWrapper({ content = 'closed', ...props }) {
return render(
,
- { preloadedState: { companionWindows: { 123: { content }, thumb: {} }, windows: { x: { thumbnailNavigationId: 'thumb' } } } },
+ { preloadedState: { companionWindows: { 123: { content }, thumb: {} }, windows: { x: { thumbnailNavigationId: 'thumb' } } }, windowId: 'x' },
);
}
diff --git a/__tests__/src/components/GalleryView.test.js b/__tests__/src/components/GalleryView.test.js
index 852f216de3..c436eb19f4 100644
--- a/__tests__/src/components/GalleryView.test.js
+++ b/__tests__/src/components/GalleryView.test.js
@@ -9,10 +9,10 @@ function createWrapper(props) {
return render(
,
+ { windowId: '1234' },
);
}
diff --git a/__tests__/src/components/PrimaryWindow.test.js b/__tests__/src/components/PrimaryWindow.test.js
index 15c636988d..726b4b12ca 100644
--- a/__tests__/src/components/PrimaryWindow.test.js
+++ b/__tests__/src/components/PrimaryWindow.test.js
@@ -6,10 +6,9 @@ function createWrapper(props) {
return render(
,
- { preloadedState: { windows: { xyz: { collectionPath: [{}], companionWindowIds: [] } } } },
+ { preloadedState: { windows: { xyz: { collectionPath: [{}], companionWindowIds: [] } } }, windowId: 'xyz' },
);
}
@@ -30,10 +29,7 @@ describe('PrimaryWindow', () => {
});
it('should render if fetching is complete and view is gallery', async () => {
createWrapper({ isFetching: false, view: 'gallery' });
- await screen.findByTestId('test-window');
- await waitFor(() => {
- expect(document.querySelector('#xyz-gallery')).toBeInTheDocument(); // eslint-disable-line testing-library/no-node-access
- });
+ expect(await screen.findByRole('region', { accessibleName: 'gallery section' })).toBeInTheDocument();
});
it('should render and if manifest is collection and isCollectionDialogVisible', async () => {
render();
@@ -42,9 +38,8 @@ describe('PrimaryWindow', () => {
classes={{}}
isCollection
isCollectionDialogVisible
- windowId="xyz"
/>,
- { preloadedState: { windows: { xyz: { collectionPath: [{}] } } } },
+ { preloadedState: { windows: { xyz: { collectionPath: [{}] } } }, windowId: 'xyz' },
);
await screen.findByRole('button', { accessibleName: 'show collection' });
});
diff --git a/__tests__/src/components/SearchResults.test.js b/__tests__/src/components/SearchResults.test.js
index c9ffce0af3..4e1526d79c 100644
--- a/__tests__/src/components/SearchResults.test.js
+++ b/__tests__/src/components/SearchResults.test.js
@@ -64,6 +64,7 @@ function createWrapper(props) {
window: {},
},
},
+ windowId: 'window',
},
);
}
diff --git a/__tests__/src/components/WindowSideBar.test.js b/__tests__/src/components/WindowSideBar.test.js
index e8e1db11b4..e1474e77f1 100644
--- a/__tests__/src/components/WindowSideBar.test.js
+++ b/__tests__/src/components/WindowSideBar.test.js
@@ -5,7 +5,6 @@ import { WindowSideBar } from '../../../src/components/WindowSideBar';
function createWrapper({ ...props }) {
return render(
,
{
@@ -17,6 +16,7 @@ function createWrapper({ ...props }) {
},
},
},
+ windowId: 'xyz',
},
);
}
diff --git a/__tests__/src/components/WindowSideBarAnnotationsPanel.test.js b/__tests__/src/components/WindowSideBarAnnotationsPanel.test.js
index 0f67d2ea1c..4e7756dca9 100644
--- a/__tests__/src/components/WindowSideBarAnnotationsPanel.test.js
+++ b/__tests__/src/components/WindowSideBarAnnotationsPanel.test.js
@@ -9,10 +9,9 @@ function createWrapper(props, state) {
annotationCount={4}
classes={{}}
id="xyz"
- windowId="abc"
{...props}
/>,
- { preloadedState: { companionWindows: { xyz: { content: 'annotations' } }, windows: { abc: {} }, ...state } },
+ { preloadedState: { companionWindows: { xyz: { content: 'annotations' } }, windows: { abc: {} }, ...state }, windowId: 'abc' },
);
}
diff --git a/__tests__/utils/test-utils.js b/__tests__/utils/test-utils.js
index e084208905..43f4ebb790 100644
--- a/__tests__/utils/test-utils.js
+++ b/__tests__/utils/test-utils.js
@@ -8,6 +8,7 @@ import { I18nextProvider } from 'react-i18next';
import createRootReducer from '../../src/state/reducers/rootReducer';
import settings from '../../src/config/settings';
import createI18nInstance from '../../src/i18n';
+import WindowContext from '../../src/contexts/WindowContext';
/** Mirador viewer setup for Integration tests */
import Mirador from '../../src/index';
@@ -29,19 +30,24 @@ function renderWithProviders(
preloadedState = {},
// Automatically create a store instance if no store was passed in
store = createStore(rootReducer, preloadedState, applyMiddleware(thunk)),
+ windowId,
...renderOptions
} = {},
) {
+ const windowContext = windowId ? { id: windowId } : {};
+
/** :nodoc: */
function Wrapper({ children }) {
return (
-
-
-
- {children}
-
-
-
+
+
+
+
+ {children}
+
+
+
+
);
}
diff --git a/src/components/AnnotationSettings.js b/src/components/AnnotationSettings.js
index 8604a2f17d..2f2ed59682 100644
--- a/src/components/AnnotationSettings.js
+++ b/src/components/AnnotationSettings.js
@@ -28,5 +28,4 @@ AnnotationSettings.propTypes = {
displayAll: PropTypes.bool.isRequired,
displayAllDisabled: PropTypes.bool.isRequired,
toggleAnnotationDisplay: PropTypes.func.isRequired,
- windowId: PropTypes.string.isRequired, // eslint-disable-line react/no-unused-prop-types
};
diff --git a/src/components/AttributionPanel.js b/src/components/AttributionPanel.js
index ce662d79b3..3537757815 100644
--- a/src/components/AttributionPanel.js
+++ b/src/components/AttributionPanel.js
@@ -26,7 +26,6 @@ export function AttributionPanel({
manifestLogo = null,
requiredStatement = null,
rights = null,
- windowId,
id,
}) {
const { t } = useTranslation();
@@ -37,7 +36,6 @@ export function AttributionPanel({
@@ -86,5 +84,4 @@ AttributionPanel.propTypes = {
value: PropTypes.string,
})),
rights: PropTypes.arrayOf(PropTypes.string),
- windowId: PropTypes.string.isRequired,
};
diff --git a/src/components/CompanionArea.js b/src/components/CompanionArea.js
index 35e17b4d49..c664be1bbb 100644
--- a/src/components/CompanionArea.js
+++ b/src/components/CompanionArea.js
@@ -97,7 +97,7 @@ export function CompanionArea({
className={`${ns('companion-windows')}`}
>
{companionWindowIds.map((id) => (
-
+
))}
diff --git a/src/components/CompanionWindowFactory.js b/src/components/CompanionWindowFactory.js
index b3511dabd9..a09aea0f48 100644
--- a/src/components/CompanionWindowFactory.js
+++ b/src/components/CompanionWindowFactory.js
@@ -10,18 +10,17 @@ import ErrorContent from '../containers/ErrorContent';
* Render a companion window using the appropriate component for the content
*/
export function CompanionWindowFactory({
- content = null, id, windowId,
+ content = null, id,
}) {
const { t } = useTranslation();
const ErroredCompanionWindow = useCallback(({ error }) => (
-
+
- ), [windowId, t, id]);
+ ), [t, id]);
const DynamicCompanionWindowType = CompanionWindowRegistry[content];
@@ -29,7 +28,7 @@ export function CompanionWindowFactory({
return (
-
+
);
}
@@ -37,5 +36,4 @@ export function CompanionWindowFactory({
CompanionWindowFactory.propTypes = {
content: PropTypes.string,
id: PropTypes.string.isRequired,
- windowId: PropTypes.string.isRequired,
};
diff --git a/src/components/CustomPanel.js b/src/components/CustomPanel.js
index 62378958a0..6107bf8892 100644
--- a/src/components/CustomPanel.js
+++ b/src/components/CustomPanel.js
@@ -6,14 +6,13 @@ import CompanionWindow from '../containers/CompanionWindow';
* a custom panel that can be used for anything
*/
export function CustomPanel({
- id, children = null, title, windowId,
+ id, children = null, title,
}) {
const { t } = useTranslation();
return (
{children}
@@ -24,5 +23,4 @@ CustomPanel.propTypes = {
children: PropTypes.node,
id: PropTypes.string.isRequired,
title: PropTypes.string.isRequired,
- windowId: PropTypes.string.isRequired,
};
diff --git a/src/components/GalleryView.js b/src/components/GalleryView.js
index 0896966f96..37bee0710c 100644
--- a/src/components/GalleryView.js
+++ b/src/components/GalleryView.js
@@ -17,7 +17,7 @@ const Root = styled(Paper, { name: 'GalleryView', slot: 'root' })(({ theme }) =>
/**
* Renders a GalleryView overview of the manifest.
*/
-export function GalleryView({ canvases, viewingDirection = '', windowId }) {
+export function GalleryView({ canvases, viewingDirection = '' }) {
const htmlDir = viewingDirection === 'right-to-left' ? 'rtl' : 'ltr';
return (
{
canvases.map(canvas => (
))
@@ -44,5 +42,4 @@ export function GalleryView({ canvases, viewingDirection = '', windowId }) {
GalleryView.propTypes = {
canvases: PropTypes.array.isRequired, // eslint-disable-line react/forbid-prop-types
viewingDirection: PropTypes.string,
- windowId: PropTypes.string.isRequired,
};
diff --git a/src/components/IIIFAuthentication.js b/src/components/IIIFAuthentication.js
index b680592cb5..1a9b67fd55 100644
--- a/src/components/IIIFAuthentication.js
+++ b/src/components/IIIFAuthentication.js
@@ -26,7 +26,6 @@ export function IIIFAuthentication({
authServiceId,
hasLogoutService: !!logoutServiceId,
status,
- windowId,
});
/** handle the IIIF logout workflow */
diff --git a/src/components/LayersPanel.js b/src/components/LayersPanel.js
index f2638236a6..b47c98fbbf 100644
--- a/src/components/LayersPanel.js
+++ b/src/components/LayersPanel.js
@@ -7,14 +7,13 @@ import CanvasLayers from '../containers/CanvasLayers';
* a panel showing the canvases for a given manifest
*/
export function LayersPanel({
- canvasIds = [], id, windowId,
+ canvasIds = [], id,
}) {
const { t } = useTranslation();
return (
{canvasIds.map((canvasId, index) => (
))}
@@ -32,5 +30,4 @@ export function LayersPanel({
LayersPanel.propTypes = {
canvasIds: PropTypes.arrayOf(PropTypes.string),
id: PropTypes.string.isRequired,
- windowId: PropTypes.string.isRequired,
};
diff --git a/src/components/OpenSeadragonViewer.js b/src/components/OpenSeadragonViewer.js
index 0e7d7fd3d1..65386b9f73 100644
--- a/src/components/OpenSeadragonViewer.js
+++ b/src/components/OpenSeadragonViewer.js
@@ -135,7 +135,7 @@ export function OpenSeadragonViewer({
);
})}
{ drawAnnotations
- && }
+ && }
{ enhancedChildren }
diff --git a/src/components/PrimaryWindow.js b/src/components/PrimaryWindow.js
index c89fe1f4b7..9ac8596ed9 100644
--- a/src/components/PrimaryWindow.js
+++ b/src/components/PrimaryWindow.js
@@ -26,41 +26,31 @@ const Root = styled('div', { name: 'PrimaryWindow', slot: 'root' })(() => ({
/** */
const TypeSpecificViewer = ({
audioResources = [], isCollection = false,
- isFetching = false, videoResources = [], view = undefined, windowId,
+ isFetching = false, videoResources = [], view = undefined,
}) => {
if (isCollection) {
return (
-
+
);
}
if (isFetching === false) {
if (view === 'gallery') {
return (
-
+
);
}
if (videoResources.length > 0) {
return (
-
+
);
}
if (audioResources.length > 0) {
return (
-
+
);
}
return (
-
+
);
}
return null;
@@ -72,7 +62,6 @@ TypeSpecificViewer.propTypes = {
isFetching: PropTypes.bool,
videoResources: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types
view: PropTypes.string,
- windowId: PropTypes.string.isRequired,
};
/**
@@ -81,7 +70,7 @@ TypeSpecificViewer.propTypes = {
*/
export function PrimaryWindow({
audioResources = undefined, isCollection = false, isFetching = false, videoResources = undefined,
- view = undefined, windowId, isCollectionDialogVisible = false, children = null, className = undefined,
+ view = undefined, isCollectionDialogVisible = false, children = null, className = undefined,
}) {
const viewerProps = {
audioResources,
@@ -89,14 +78,13 @@ export function PrimaryWindow({
isFetching,
videoResources,
view,
- windowId,
};
return (
-
-
- { isCollectionDialogVisible && }
+
+
+ { isCollectionDialogVisible && }
}>
{children || }
@@ -113,5 +101,4 @@ PrimaryWindow.propTypes = {
isFetching: PropTypes.bool,
videoResources: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types
view: PropTypes.string,
- windowId: PropTypes.string.isRequired,
};
diff --git a/src/components/SearchPanel.js b/src/components/SearchPanel.js
index 8ea3775f47..53472733f5 100644
--- a/src/components/SearchPanel.js
+++ b/src/components/SearchPanel.js
@@ -10,7 +10,7 @@ import SearchResults from '../containers/SearchResults';
/** */
export function SearchPanel({
- fetchSearch = undefined, id, query = '', removeSearch, searchService, suggestedSearches = [], windowId,
+ fetchSearch = undefined, id, query = '', removeSearch, searchService, suggestedSearches = [],
}) {
const { t } = useTranslation();
const containerRef = useRef(null);
@@ -38,15 +38,13 @@ export function SearchPanel({
}
>
)}
- windowId={windowId}
id={id}
- titleControls={}
+ titleControls={}
ref={containerRef}
>
{
fetchSearch && suggestedSearches && query === '' && suggestedSearches.map(search => (
@@ -74,5 +72,4 @@ SearchPanel.propTypes = {
id: PropTypes.string,
}).isRequired,
suggestedSearches: PropTypes.arrayOf(PropTypes.string),
- windowId: PropTypes.string.isRequired,
};
diff --git a/src/components/SearchPanelControls.js b/src/components/SearchPanelControls.js
index 6c1e0d777c..547ff653a6 100644
--- a/src/components/SearchPanelControls.js
+++ b/src/components/SearchPanelControls.js
@@ -145,7 +145,7 @@ export function SearchPanelControls({
)}
/>
-
+
>
);
}
diff --git a/src/components/SearchPanelNavigation.js b/src/components/SearchPanelNavigation.js
index dda62b236e..77a6283e68 100644
--- a/src/components/SearchPanelNavigation.js
+++ b/src/components/SearchPanelNavigation.js
@@ -79,5 +79,4 @@ SearchPanelNavigation.propTypes = {
}).isRequired,
selectAnnotation: PropTypes.func.isRequired,
selectedContentSearchAnnotation: PropTypes.arrayOf(PropTypes.string).isRequired,
- windowId: PropTypes.string.isRequired, // eslint-disable-line react/no-unused-prop-types
};
diff --git a/src/components/SearchResults.js b/src/components/SearchResults.js
index ec2b903447..5826f05a8c 100644
--- a/src/components/SearchResults.js
+++ b/src/components/SearchResults.js
@@ -18,7 +18,6 @@ function SearchHitsAndAnnotations({
containerRef,
searchAnnotations,
searchHits,
- windowId,
focused,
toggleFocus,
}) {
@@ -33,7 +32,6 @@ function SearchHitsAndAnnotations({
focused={focused}
index={index}
total={searchAnnotations.length}
- windowId={windowId}
showDetails={toggleFocus}
/>
));
@@ -49,7 +47,6 @@ function SearchHitsAndAnnotations({
hit={hit}
index={index}
total={searchHits.length}
- windowId={windowId}
showDetails={toggleFocus}
/>
));
@@ -105,7 +102,6 @@ export function SearchResults({
containerRef={containerRef}
searchAnnotations={searchAnnotations}
searchHits={searchHits}
- windowId={windowId}
focused={focused}
toggleFocus={toggleFocus}
/>
diff --git a/src/components/ThumbnailNavigation.js b/src/components/ThumbnailNavigation.js
index 8bf4445129..fe68c9531e 100644
--- a/src/components/ThumbnailNavigation.js
+++ b/src/components/ThumbnailNavigation.js
@@ -12,7 +12,7 @@ import ns from '../config/css-ns';
*/
export function ThumbnailNavigation({
canvasGroupings, canvasIndex, hasNextCanvas = false, hasPreviousCanvas = false, position,
- setNextCanvas = () => {}, setPreviousCanvas = () => {}, thumbnailNavigation, view = undefined, viewingDirection = '', windowId,
+ setNextCanvas = () => {}, setPreviousCanvas = () => {}, thumbnailNavigation, view = undefined, viewingDirection = '',
}) {
const { t } = useTranslation();
const scrollbarSize = 15;
@@ -145,7 +145,6 @@ export function ThumbnailNavigation({
canvasGroupings,
height: thumbnailNavigation.height - spacing - scrollbarSize,
position,
- windowId,
};
return (
{
);
};
+/** a minimal window for displaying an error message */
+const ErrorWindow = ({ error }) => (
+
+
+
+);
+
+ErrorWindow.propTypes = {
+ error: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
+};
+
/**
* Represents a Window in the mirador workspace
* @param {object} window
@@ -87,11 +99,6 @@ export function Window({
}) {
const { t } = useTranslation();
const ownerState = arguments[0]; // eslint-disable-line prefer-rest-params
- const ErrorWindow = useCallback(({ error }) => (
-
-
-
- ), [windowId]);
return (
@@ -99,34 +106,32 @@ export function Window({
onFocus={focusWindow}
ownerState={ownerState}
component="section"
- elevation={1}
id={windowId}
+ elevation={1}
className={ns('window')}
aria-label={t('window', { label })}
>
-
- { manifestError && }
+
+ { manifestError && }
-
+
-
-
+
+
-
+
diff --git a/src/components/WindowCanvasNavigationControls.js b/src/components/WindowCanvasNavigationControls.js
index a6b0a97217..f03a27e4bb 100644
--- a/src/components/WindowCanvasNavigationControls.js
+++ b/src/components/WindowCanvasNavigationControls.js
@@ -34,19 +34,19 @@ const Root = styled(Paper, { name: 'WindowCanvasNavigationControls', slot: 'root
* Represents the viewer controls in the mirador workspace.
*/
export const WindowCanvasNavigationControls = forwardRef(({
- showZoomControls = false, visible = true, windowId, zoomToWorld, ...rest
+ showZoomControls = false, visible = true, zoomToWorld, ...rest
}, ref) => {
const [sizeRef, size] = useElementSize();
const pluginProps = {
- showZoomControls, size, visible, windowId, ...rest,
+ showZoomControls, size, visible, ...rest,
};
/**
* Determine if canvasNavControls are stacked (based on a hard-coded width)
*/
const canvasNavControlsAreStacked = (size && size.width && size.width <= 253);
- if (!visible) return ();
+ if (!visible) return ();
return (
}
spacing={0}
>
- { showZoomControls && }
-
+ { showZoomControls && }
+
-
+
@@ -79,7 +79,6 @@ WindowCanvasNavigationControls.propTypes = {
showZoomControls: PropTypes.bool,
size: PropTypes.shape({ width: PropTypes.number }).isRequired,
visible: PropTypes.bool,
- windowId: PropTypes.string.isRequired,
zoomToWorld: PropTypes.func.isRequired,
};
diff --git a/src/components/WindowSideBar.js b/src/components/WindowSideBar.js
index 041b23c1c2..0e1f418760 100644
--- a/src/components/WindowSideBar.js
+++ b/src/components/WindowSideBar.js
@@ -19,7 +19,7 @@ const Nav = styled('nav', { name: 'WindowSideBar', slot: 'nav' })({
* WindowSideBar
*/
export function WindowSideBar({
- classes = {}, direction, windowId, sideBarOpen = false,
+ classes = {}, direction, sideBarOpen = false,
}) {
const { t } = useTranslation();
return (
@@ -35,7 +35,7 @@ export function WindowSideBar({
SlideProps={{ direction: direction === 'rtl' ? 'left' : 'right', mountOnEnter: true, unmountOnExit: true }}
open={sideBarOpen}
>
-
+
);
}
@@ -44,5 +44,4 @@ WindowSideBar.propTypes = {
classes: PropTypes.objectOf(PropTypes.string),
direction: PropTypes.string.isRequired,
sideBarOpen: PropTypes.bool,
- windowId: PropTypes.string.isRequired,
};
diff --git a/src/components/WindowSideBarAnnotationsPanel.js b/src/components/WindowSideBarAnnotationsPanel.js
index c22f069eae..5219839c17 100644
--- a/src/components/WindowSideBarAnnotationsPanel.js
+++ b/src/components/WindowSideBarAnnotationsPanel.js
@@ -12,7 +12,7 @@ import ns from '../config/css-ns';
* WindowSideBarAnnotationsPanel ~
*/
export function WindowSideBarAnnotationsPanel({
- annotationCount, canvasIds = [], windowId, id,
+ annotationCount, canvasIds = [], id,
}) {
const { t } = useTranslation();
const containerRef = createRef();
@@ -20,10 +20,9 @@ export function WindowSideBarAnnotationsPanel({
}
+ titleControls={}
>
{t('showingNumAnnotations', { count: annotationCount, number: annotationCount })}
@@ -36,7 +35,6 @@ export function WindowSideBarAnnotationsPanel({
key={canvasId}
index={index}
totalSize={canvasIds.length}
- windowId={windowId}
/>
))}
@@ -47,5 +45,4 @@ WindowSideBarAnnotationsPanel.propTypes = {
annotationCount: PropTypes.number.isRequired,
canvasIds: PropTypes.arrayOf(PropTypes.string),
id: PropTypes.string.isRequired,
- windowId: PropTypes.string.isRequired,
};
diff --git a/src/components/WindowSideBarCanvasPanel.js b/src/components/WindowSideBarCanvasPanel.js
index 59953f2275..5e9bf8e6b6 100644
--- a/src/components/WindowSideBarCanvasPanel.js
+++ b/src/components/WindowSideBarCanvasPanel.js
@@ -45,7 +45,6 @@ export function WindowSideBarCanvasPanel({
showToc = false,
updateSequence,
updateVariant,
- windowId,
}) {
const { t } = useTranslation();
const containerRef = useRef();
@@ -67,7 +66,6 @@ export function WindowSideBarCanvasPanel({
);
} else {
@@ -75,7 +73,6 @@ export function WindowSideBarCanvasPanel({
);
}
@@ -84,7 +81,6 @@ export function WindowSideBarCanvasPanel({
@@ -162,5 +158,4 @@ WindowSideBarCanvasPanel.propTypes = {
updateSequence: PropTypes.func.isRequired,
updateVariant: PropTypes.func.isRequired,
variant: PropTypes.oneOf(['item', 'thumbnail', 'tableOfContents']).isRequired,
- windowId: PropTypes.string.isRequired,
};
diff --git a/src/components/WindowSideBarCollectionPanel.js b/src/components/WindowSideBarCollectionPanel.js
index 6f71e38ab5..c31bebe1fd 100644
--- a/src/components/WindowSideBarCollectionPanel.js
+++ b/src/components/WindowSideBarCollectionPanel.js
@@ -72,7 +72,6 @@ export function WindowSideBarCollectionPanel({
updateCompanionWindow,
updateWindow,
variant = null,
- windowId,
}) {
const { t } = useTranslation();
/** */
@@ -89,7 +88,6 @@ export function WindowSideBarCollectionPanel({
return (
@@ -188,5 +186,4 @@ WindowSideBarCollectionPanel.propTypes = {
updateCompanionWindow: PropTypes.func.isRequired,
updateWindow: PropTypes.func.isRequired,
variant: PropTypes.string,
- windowId: PropTypes.string.isRequired,
};
diff --git a/src/components/WindowSideBarInfoPanel.js b/src/components/WindowSideBarInfoPanel.js
index fc367a7c7f..b664a496b1 100644
--- a/src/components/WindowSideBarInfoPanel.js
+++ b/src/components/WindowSideBarInfoPanel.js
@@ -13,7 +13,6 @@ import ns from '../config/css-ns';
* WindowSideBarInfoPanel
*/
export function WindowSideBarInfoPanel({
- windowId,
id,
canvasIds = [],
collectionPath = [],
@@ -27,7 +26,6 @@ export function WindowSideBarInfoPanel({
))
}
{ collectionPath.length > 0 && (
-
+
)}
-
+
-
+
);
@@ -80,5 +77,4 @@ WindowSideBarInfoPanel.propTypes = {
locale: PropTypes.string,
setLocale: PropTypes.func,
showLocalePicker: PropTypes.bool,
- windowId: PropTypes.string.isRequired,
};
diff --git a/src/components/WindowTopBar.js b/src/components/WindowTopBar.js
index fe3d7bf978..000dbf4769 100644
--- a/src/components/WindowTopBar.js
+++ b/src/components/WindowTopBar.js
@@ -36,7 +36,7 @@ const StyledToolbar = styled(Toolbar, { name: 'WindowTopBar', slot: 'toolbar' })
* WindowTopBar
*/
export function WindowTopBar({
- removeWindow, windowId, toggleWindowSideBar,
+ removeWindow, toggleWindowSideBar,
maximizeWindow = () => {}, maximized = false, minimizeWindow = () => {}, allowClose = true, allowMaximize = true,
focusWindow = () => {}, allowFullscreen = false, allowTopMenuButton = true, allowWindowSideBar = true,
component = 'nav',
@@ -62,14 +62,12 @@ export function WindowTopBar({
)}
-
+
{allowTopMenuButton && (
-
+
)}
-
-
+
+
{allowMaximize && (
-
+
{showThumbnailNavigationSettings
- && }
+ && }
);
@@ -61,5 +61,4 @@ WindowTopMenu.propTypes = {
open: PropTypes.bool,
showThumbnailNavigationSettings: PropTypes.bool,
toggleDraggingEnabled: PropTypes.func.isRequired,
- windowId: PropTypes.string.isRequired,
};
diff --git a/src/components/WindowTopMenuButton.js b/src/components/WindowTopMenuButton.js
index 75a70a5f39..f55b12e2c0 100644
--- a/src/components/WindowTopMenuButton.js
+++ b/src/components/WindowTopMenuButton.js
@@ -1,4 +1,4 @@
-import { useState } from 'react';
+import { useId, useState } from 'react';
import PropTypes from 'prop-types';
import { useTranslation } from 'react-i18next';
import WindowTopMenu from '../containers/WindowTopMenu';
@@ -7,7 +7,7 @@ import WindowOptionsIcon from './icons/WindowOptionsIcon';
/**
*/
-export function WindowTopMenuButton({ classes = {}, windowId }) {
+export function WindowTopMenuButton({ classes = {} }) {
const { t } = useTranslation();
const [anchorEl, setAnchorEl] = useState(null);
const [open, setOpen] = useState(false);
@@ -24,7 +24,7 @@ export function WindowTopMenuButton({ classes = {}, windowId }) {
setOpen(false);
};
- const menuId = `window-menu_${windowId}`;
+ const menuId = useId();
return (
<>