Skip to content
Snippets Groups Projects
Commit 793ebead authored by Sinzeanu Demetriad's avatar Sinzeanu Demetriad
Browse files

docs(faradai-ui): update tag items docs

parent 79062906
No related branches found
No related tags found
3 merge requests!222Sprint #26,!217Sprint #26,!191Hin 1116 documentation
import { has } from 'lodash' import { get } from 'lodash'
import PropTypes from 'prop-types'
import { th } from '@pubsweet/ui-toolkit' import { th } from '@pubsweet/ui-toolkit'
import styled, { css } from 'styled-components' import styled, { css } from 'styled-components'
import { marginHelper } from './styledHelpers' import { marginHelper } from './styledHelpers'
const tagCSS = props => { const tagCSS = props => {
if (has(props, 'oldStatus')) { if (get(props, 'oldStatus')) {
return css` return css`
background-color: ${th('colorFurnitureHue')}; background-color: ${th('colorFurnitureHue')};
height: calc(${th('gridUnit')} * 3) height: calc(${th('gridUnit')} * 3)
...@@ -15,7 +16,7 @@ const tagCSS = props => { ...@@ -15,7 +16,7 @@ const tagCSS = props => {
` `
} }
if (has(props, `status`)) { if (get(props, `status`)) {
return css` return css`
background-color: ${th('tag.statusBackgroundColor')}; background-color: ${th('tag.statusBackgroundColor')};
padding: calc(${th('gridUnit')} / 4) ${th('gridUnit')}; padding: calc(${th('gridUnit')} / 4) ${th('gridUnit')};
...@@ -35,7 +36,7 @@ const tagCSS = props => { ...@@ -35,7 +36,7 @@ const tagCSS = props => {
} }
/** @component */ /** @component */
export default styled.div` const Tag = styled.div`
border-radius: ${th('tag.borderRadius') border-radius: ${th('tag.borderRadius')
? th('tag.borderRadius') ? th('tag.borderRadius')
: th('borderRadius')}; : th('borderRadius')};
...@@ -52,3 +53,17 @@ export default styled.div` ...@@ -52,3 +53,17 @@ export default styled.div`
${tagCSS}; ${tagCSS};
${marginHelper}; ${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
...@@ -100,23 +100,23 @@ const Text = ({ bullet, children, ...rest }) => ...@@ -100,23 +100,23 @@ const Text = ({ bullet, children, ...rest }) =>
) )
Text.propTypes = { Text.propTypes = {
/** if true */ /** if true then object gets properties. */
secondary: PropTypes.bool, secondary: PropTypes.bool,
/** if true then object gets properties */ /** if true then object gets properties. */
error: PropTypes.bool, error: PropTypes.bool,
/** if true then object gets properties */ /** if true then object gets properties. */
customId: PropTypes.bool, customId: PropTypes.bool,
/** if true then object gets properties */ /** if true then object gets properties. */
labelLine: PropTypes.bool, labelLine: PropTypes.bool,
/** if true then object gets properties */ /** if true then object gets properties. */
journal: PropTypes.bool, journal: PropTypes.bool,
/** if true thenobject gets properties */ /** if true thenobject gets properties. */
small: PropTypes.bool, small: PropTypes.bool,
/** defines how items will be displayed */ /** defines how items will be displayed. */
display: PropTypes.string, display: PropTypes.string,
/** defines how items will be aligned */ /** defines how items will be aligned. */
align: PropTypes.string, align: PropTypes.string,
/** defines if there will be a white space */ /** defines if there will be a white space. */
whiteSpace: PropTypes.string, whiteSpace: PropTypes.string,
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment