Skip to content
Snippets Groups Projects
Commit 6b6c11ab authored by Alexandru Munteanu's avatar Alexandru Munteanu
Browse files

feat(text): add bullet prop

parent 21950f66
No related branches found
No related tags found
1 merge request!43Sprint #19
import React from 'react'
import { has, get } from 'lodash' import { has, get } from 'lodash'
import { th } from '@pubsweet/ui-toolkit' import { th } from '@pubsweet/ui-toolkit'
import styled, { css } from 'styled-components' import styled, { css } from 'styled-components'
...@@ -50,14 +51,38 @@ const fontSize = css` ...@@ -50,14 +51,38 @@ const fontSize = css`
props.small ? th('lineHeightBaseSmall') : th('lineHeightBase')}; props.small ? th('lineHeightBaseSmall') : th('lineHeightBase')};
` `
/** @component */ const StyledText = styled.span`
export default styled.span`
align-items: center; align-items: center;
display: ${props => get(props, 'display', 'inline-block')}; display: ${props => get(props, 'display', 'inline-block')};
font-style: ${props => props.fontStyle || 'normal'}; font-style: ${props => get(props, 'fontStyle', 'normal')};
text-align: ${props => props.align || 'start'}; text-align: ${props => get(props, 'align', 'start')};
${fontSize}; ${fontSize};
${textHelper}; ${textHelper};
${marginHelper}; ${marginHelper};
${paddingHelper}; ${paddingHelper};
` `
const Bullet = styled.span`
color: ${th('colorWarning')};
font-size: ${th('fontSizeHeading2')};
line-height: 0;
margin-right: ${th('gridUnit')};
padding-top: ${th('gridUnit')};
vertical-align: middle;
`
const Root = styled.div`
align-items: flex-start;
display: flex;
`
export default ({ bullet, children, ...rest }) =>
bullet ? (
<Root>
<Bullet>{'\u2022'}</Bullet>
<StyledText {...rest}>{children}</StyledText>
</Root>
) : (
<StyledText {...rest}>{children}</StyledText>
)
...@@ -4,6 +4,15 @@ A piece of text. (Body 1) ...@@ -4,6 +4,15 @@ A piece of text. (Body 1)
<Text>my boy is amazing</Text> <Text>my boy is amazing</Text>
``` ```
A piece of text with a bullet.
```js
<Text bullet>
I am like a list item{' '}
<ActionLink to="https://www.google.com">google</ActionLink>
</Text>
```
A secondary text. (Body 2) A secondary text. (Body 2)
```js ```js
...@@ -25,5 +34,13 @@ A small text. ...@@ -25,5 +34,13 @@ A small text.
A small secondary text. A small secondary text.
```js ```js
<Text small secondary>my boy is amazing</Text> <Text small secondary>
my boy is amazing
</Text>
```
Text used as a label line.
```js
<Text labelLine>SUPPLEMENTARY FILES</Text>
``` ```
...@@ -14,7 +14,7 @@ const StepOne = () => ( ...@@ -14,7 +14,7 @@ const StepOne = () => (
</Text> </Text>
</Row> </Row>
<Row alignItems="center" justify="flex-start" mb={1}> <Row alignItems="center" justify="flex-start" mb={1}>
<Text> <Text bullet>
I am aware that accepted manuscripts are subject to an I am aware that accepted manuscripts are subject to an
<ActionLink pl={1 / 2} pr={1 / 2} to="https://www.hindawi.com/apc/"> <ActionLink pl={1 / 2} pr={1 / 2} to="https://www.hindawi.com/apc/">
Article Processing Charge of $1,250. Article Processing Charge of $1,250.
...@@ -22,30 +22,30 @@ const StepOne = () => ( ...@@ -22,30 +22,30 @@ const StepOne = () => (
</Text> </Text>
</Row> </Row>
<Row alignItems="center" justify="flex-start" mb={1}> <Row alignItems="center" justify="flex-start" mb={1}>
<Text> <Text bullet>
All co-authors have read and agreed on the current version of this All co-authors have read and agreed on the current version of this
manuscript. manuscript.
</Text> </Text>
</Row> </Row>
<Row alignItems="center" justify="flex-start" mb={1}> <Row alignItems="center" justify="flex-start" mb={1}>
<Text> <Text bullet>
I have the email addresses of all co-authors of the manuscript. I have the email addresses of all co-authors of the manuscript.
</Text> </Text>
</Row> </Row>
<Row alignItems="center" justify="flex-start" mb={1}> <Row alignItems="center" justify="flex-start" mb={1}>
<Text> <Text bullet>
I confirm the main manuscript file is in Microsoft Word or Adobe PDF I confirm the main manuscript file is in Microsoft Word or Adobe PDF
format with the tables and figures integrated in the manuscript body. format with the tables and figures integrated in the manuscript body.
</Text> </Text>
</Row> </Row>
<Row alignItems="center" justify="flex-start" mb={1}> <Row alignItems="center" justify="flex-start" mb={1}>
<Text> <Text bullet>
I have all additional electronic files of supplementary materials (e.g. I have all additional electronic files of supplementary materials (e.g.
Datasets, images, audio, video) ready. Datasets, images, audio, video) ready.
</Text> </Text>
</Row> </Row>
<Row alignItems="center" justify="flex-start" mb={1}> <Row alignItems="center" justify="flex-start" mb={1}>
<Text> <Text bullet>
I am aware that an I am aware that an
<ActionLink pl={1 / 2} pr={1 / 2} to="https://orcid.org/"> <ActionLink pl={1 / 2} pr={1 / 2} to="https://orcid.org/">
ORCID ORCID
...@@ -56,7 +56,7 @@ const StepOne = () => ( ...@@ -56,7 +56,7 @@ const StepOne = () => (
</Text> </Text>
</Row> </Row>
<Row alignItems="center" justify="flex-start" mb={1}> <Row alignItems="center" justify="flex-start" mb={1}>
<Text> <Text bullet>
I am aware that an I am aware that an
<ActionLink pl={1 / 2} pr={1 / 2} to="https://www.hindawi.com/members/"> <ActionLink pl={1 / 2} pr={1 / 2} to="https://www.hindawi.com/members/">
institutional membership institutional membership
......
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