Skip to content

Commit

Permalink
Merge pull request #4072 from ProjectMirador/prop-warnings
Browse files Browse the repository at this point in the history
Get rid of some prop type console warnings
  • Loading branch information
cbeer authored Jan 8, 2025
2 parents f04609f + 1b4c943 commit 3930da8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
11 changes: 6 additions & 5 deletions src/components/IIIFAuthentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@ 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,
resetAuthenticationState, resolveAccessTokenRequest, resolveAuthenticationRequest,
status = null, windowId,
}) {
const { t } = useTranslation();

if (!accessTokenServiceId || !authServiceId) return null;

/** */
const onReceiveAccessTokenMessage = (payload) => {
resolveAccessTokenRequest(authServiceId, accessTokenServiceId, payload);
Expand Down Expand Up @@ -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();
Expand All @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions src/components/IIIFThumbnail.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/components/WindowSideBarButtons.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

0 comments on commit 3930da8

Please sign in to comment.