diff --git a/packages/component-faraday-ui/src/Tag.js b/packages/component-faraday-ui/src/Tag.js index fd6ce0316577b29f1ca95619cdd180a860209c54..3c6997d15e07f9420cfd88520f5c5e69a60de095 100644 --- a/packages/component-faraday-ui/src/Tag.js +++ b/packages/component-faraday-ui/src/Tag.js @@ -1,11 +1,12 @@ -import { has } from 'lodash' +import { get } from 'lodash' +import PropTypes from 'prop-types' import { th } from '@pubsweet/ui-toolkit' import styled, { css } from 'styled-components' import { marginHelper } from './styledHelpers' const tagCSS = props => { - if (has(props, 'oldStatus')) { + if (get(props, 'oldStatus')) { return css` background-color: ${th('colorFurnitureHue')}; height: calc(${th('gridUnit')} * 3) @@ -15,7 +16,7 @@ const tagCSS = props => { ` } - if (has(props, `status`)) { + if (get(props, `status`)) { return css` background-color: ${th('tag.statusBackgroundColor')}; padding: calc(${th('gridUnit')} / 4) ${th('gridUnit')}; @@ -35,7 +36,7 @@ const tagCSS = props => { } /** @component */ -export default styled.div` +const Tag = styled.div` border-radius: ${th('tag.borderRadius') ? th('tag.borderRadius') : th('borderRadius')}; @@ -52,3 +53,17 @@ export default styled.div` ${tagCSS}; ${marginHelper}; ` + +Tag.propTypes = { + /** if true then object gets properties. */ + oldStatus: PropTypes.bool, + /** if true then object gets properties. */ + status: PropTypes.boo, +} + +Tag.defaultProps = { + oldStatus: false, + status: false, +} + +export default Tag diff --git a/packages/component-faraday-ui/src/Text.js b/packages/component-faraday-ui/src/Text.js index 0368f97a32f5e757721c9e39f73ec03f8dfef790..06d321cd457795456583e71f4d179e750427f202 100644 --- a/packages/component-faraday-ui/src/Text.js +++ b/packages/component-faraday-ui/src/Text.js @@ -100,23 +100,23 @@ const Text = ({ bullet, children, ...rest }) => ) Text.propTypes = { - /** if true */ + /** if true then object gets properties. */ secondary: PropTypes.bool, - /** if true then object gets properties */ + /** if true then object gets properties. */ error: PropTypes.bool, - /** if true then object gets properties */ + /** if true then object gets properties. */ customId: PropTypes.bool, - /** if true then object gets properties */ + /** if true then object gets properties. */ labelLine: PropTypes.bool, - /** if true then object gets properties */ + /** if true then object gets properties. */ journal: PropTypes.bool, - /** if true thenobject gets properties */ + /** if true thenobject gets properties. */ small: PropTypes.bool, - /** defines how items will be displayed */ + /** defines how items will be displayed. */ display: PropTypes.string, - /** defines how items will be aligned */ + /** defines how items will be aligned. */ align: PropTypes.string, - /** defines if there will be a white space */ + /** defines if there will be a white space. */ whiteSpace: PropTypes.string, }