diff --git a/packages/component-faraday-ui/src/AuthorTag.js b/packages/component-faraday-ui/src/AuthorTag.js index 00168896ff392ebf7cffefea85486b7f3a34eecd..4ec4cf6a3b28b21216fef66e39d21175835b5a48 100644 --- a/packages/component-faraday-ui/src/AuthorTag.js +++ b/packages/component-faraday-ui/src/AuthorTag.js @@ -26,9 +26,9 @@ const AuthorTag = ({ AuthorTag.propTypes = { /** The author you want to be on the card. */ author: PropTypes.shape({ - id: PropTypes.number, - firstName: PropTypes.number, - lastName: PropTypes.number, + id: PropTypes.string, + firstName: PropTypes.string, + lastName: PropTypes.string, isCorresponding: PropTypes.bool, isSubmitting: PropTypes.bool, affiliationNumber: PropTypes.number, diff --git a/packages/component-faraday-ui/src/AutosaveIndicator.js b/packages/component-faraday-ui/src/AutosaveIndicator.js index 2fa2048bdb53caf97aa349a14dee5a2c09a0e495..1a3b309ff177e412df6fb305d087acd8b9b62a43 100644 --- a/packages/component-faraday-ui/src/AutosaveIndicator.js +++ b/packages/component-faraday-ui/src/AutosaveIndicator.js @@ -102,13 +102,11 @@ export default compose( AutosaveIndicator.propTypes = { /** Make appear loader until save. */ - autosave: PropTypes.objectOf( - PropTypes.oneOfType([PropTypes.bool, PropTypes.date, PropTypes.string]), - ), + autosave: PropTypes.object, // eslint-disable-line } AutosaveIndicator.defaultProps = { - autosave: undefined, + autosave: {}, } // #region styles const Root = styled.div` diff --git a/packages/component-faraday-ui/src/ContextualBox.js b/packages/component-faraday-ui/src/ContextualBox.js index 40e3e6f5f8b7b71933eafc303222f179a3f70b5b..f2c0d0d9b751ac5c0380d0efbab892830bae54da 100644 --- a/packages/component-faraday-ui/src/ContextualBox.js +++ b/packages/component-faraday-ui/src/ContextualBox.js @@ -1,6 +1,6 @@ import React from 'react' import PropTypes from 'prop-types' -import { has } from 'lodash' +import { isUndefined } from 'lodash' import styled from 'styled-components' import { Icon, H3 } from '@pubsweet/ui' import { override, th } from '@pubsweet/ui-toolkit' @@ -35,7 +35,7 @@ const CustomHeader = ({ ) const ContextualBox = ({ label, children, rightChildren, ...props }) => - has(props, 'expanded') ? ( + !isUndefined(props.expanded) ? ( <ControlledAccordion header={CustomHeader} label={label} @@ -61,7 +61,7 @@ ContextualBox.propTypes = { /** Label of the contextual box. */ label: PropTypes.string, /** Component or html to be rendered on the right side. */ - rightChildren: PropTypes.oneOfType([PropTypes.element, PropTypes.func]), + rightChildren: PropTypes.any, // eslint-disable-line /** The state of the contextual box. If passed from a parent then the component * is controlled and can be expanded/collapsed remotely. */ @@ -69,13 +69,12 @@ ContextualBox.propTypes = { /** Callback function used to control the state of the component. * To be used together with the `expanded` prop. */ - toggle: PropTypes.func, + toggle: PropTypes.func, // eslint-disable-line } ContextualBox.defaultProps = { label: '', - rightChildren: undefined, - toggle: null, + // rightChildren: undefined, } // #region styles