diff --git a/src/components/IIIFAuthentication.js b/src/components/IIIFAuthentication.js index b680592cb..8535070dc 100644 --- a/src/components/IIIFAuthentication.js +++ b/src/components/IIIFAuthentication.js @@ -8,7 +8,7 @@ import WindowAuthenticationBar from '../containers/WindowAuthenticationBar'; * Opens a new window for click */ export function IIIFAuthentication({ - accessTokenServiceId, authServiceId, confirm = undefined, description = undefined, + accessTokenServiceId = undefined, authServiceId = undefined, confirm = undefined, description = undefined, failureDescription = undefined, failureHeader = undefined, features = 'centerscreen', handleAuthInteraction, header = undefined, isInteractive = true, label = undefined, logoutConfirm = undefined, logoutServiceId = undefined, openWindow = window.open, @@ -16,6 +16,9 @@ export function IIIFAuthentication({ status = null, windowId, }) { const { t } = useTranslation(); + + if (!accessTokenServiceId || !authServiceId) return null; + /** */ const onReceiveAccessTokenMessage = (payload) => { resolveAccessTokenRequest(authServiceId, accessTokenServiceId, payload); @@ -95,8 +98,6 @@ export function IIIFAuthentication({ ); }; - if (!authServiceId) return null; - if (status === null) return renderLogin(); if (status === 'cookie') return renderLoggingInCookie(); if (status === 'token') return renderLoggingInToken(); @@ -107,8 +108,8 @@ export function IIIFAuthentication({ } IIIFAuthentication.propTypes = { - accessTokenServiceId: PropTypes.string.isRequired, - authServiceId: PropTypes.string.isRequired, + accessTokenServiceId: PropTypes.string, + authServiceId: PropTypes.string, confirm: PropTypes.string, description: PropTypes.string, failureDescription: PropTypes.string, diff --git a/src/components/IIIFThumbnail.js b/src/components/IIIFThumbnail.js index 2feea6651..ee56d2f28 100644 --- a/src/components/IIIFThumbnail.js +++ b/src/components/IIIFThumbnail.js @@ -23,7 +23,7 @@ const Image = styled('img', { name: 'IIIFThumbnail', slot: 'image' })(() => ({ */ const LazyLoadedImage = ({ border = false, placeholder, style = {}, thumbnail = null, - resource, maxHeight, maxWidth, thumbnailsConfig = {}, ...props + resource, maxHeight = null, maxWidth = null, thumbnailsConfig = {}, ...props }) => { const { ref, inView } = useInView(); const [loaded, setLoaded] = useState(false); @@ -117,8 +117,8 @@ const LazyLoadedImage = ({ LazyLoadedImage.propTypes = { border: PropTypes.bool, - maxHeight: PropTypes.number.isRequired, - maxWidth: PropTypes.number.isRequired, + maxHeight: PropTypes.number, + maxWidth: PropTypes.number, placeholder: PropTypes.string.isRequired, resource: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types style: PropTypes.object, // eslint-disable-line react/forbid-prop-types diff --git a/src/components/WindowSideBarButtons.js b/src/components/WindowSideBarButtons.js index 7bf1ab3f0..72639f1ab 100644 --- a/src/components/WindowSideBarButtons.js +++ b/src/components/WindowSideBarButtons.js @@ -171,7 +171,7 @@ WindowSideBarButtons.propTypes = { hasCurrentLayers: PropTypes.bool, hasSearchResults: PropTypes.bool, hasSearchService: PropTypes.bool, - panels: PropTypes.arrayOf(PropTypes.bool), + panels: PropTypes.objectOf(PropTypes.bool), PluginComponents: PropTypes.array, // eslint-disable-line react/forbid-prop-types sideBarPanel: PropTypes.string, };