RN-109 Added ability to add styles to adjacent paragraphs (#654)
* RN-109 Added ability to add styles to adjacent paragraphs * Updated yarn.lock
This commit is contained in:
parent
724d7ae099
commit
22b71797ce
4 changed files with 13 additions and 5 deletions
|
|
@ -167,9 +167,14 @@ export default class Markdown extends React.PureComponent {
|
|||
);
|
||||
}
|
||||
|
||||
renderParagraph = ({children}) => {
|
||||
renderParagraph = ({children, first}) => {
|
||||
const blockStyle = [style.block];
|
||||
if (!first) {
|
||||
blockStyle.push(this.props.blockStyles.adjacentParagraph);
|
||||
}
|
||||
|
||||
return (
|
||||
<View style={style.block}>
|
||||
<View style={blockStyle}>
|
||||
<Text>
|
||||
{children}
|
||||
</Text>
|
||||
|
|
|
|||
|
|
@ -71,6 +71,9 @@ export const getMarkdownTextStyles = makeStyleSheetFromTheme((theme) => {
|
|||
|
||||
export const getMarkdownBlockStyles = makeStyleSheetFromTheme((theme) => {
|
||||
return StyleSheet.create({
|
||||
adjacentParagraph: {
|
||||
marginTop: 6
|
||||
},
|
||||
codeBlock: {
|
||||
backgroundColor: changeOpacity(theme.centerChannelColor, 0.1),
|
||||
borderRadius: 4,
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
"dependencies": {
|
||||
"babel-polyfill": "6.23.0",
|
||||
"commonmark": "hmhealey/commonmark.js#10bc18c0c8054088c0ec4737a8766c6b5794a323",
|
||||
"commonmark-react-renderer": "hmhealey/commonmark-react-renderer#7be9f10cdb3408a64366a20e60975edff0b5c710",
|
||||
"commonmark-react-renderer": "hmhealey/commonmark-react-renderer#11bf3a089900eda6f3e951f8b8c80663cff4d6a3",
|
||||
"deep-equal": "1.0.1",
|
||||
"intl": "1.2.5",
|
||||
"mattermost-redux": "mattermost/mattermost-redux#master",
|
||||
|
|
|
|||
|
|
@ -1512,9 +1512,9 @@ commondir@^1.0.1:
|
|||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b"
|
||||
|
||||
commonmark-react-renderer@hmhealey/commonmark-react-renderer#7be9f10cdb3408a64366a20e60975edff0b5c710:
|
||||
commonmark-react-renderer@hmhealey/commonmark-react-renderer#11bf3a089900eda6f3e951f8b8c80663cff4d6a3:
|
||||
version "4.3.2"
|
||||
resolved "https://codeload.github.com/hmhealey/commonmark-react-renderer/tar.gz/7be9f10cdb3408a64366a20e60975edff0b5c710"
|
||||
resolved "https://codeload.github.com/hmhealey/commonmark-react-renderer/tar.gz/11bf3a089900eda6f3e951f8b8c80663cff4d6a3"
|
||||
dependencies:
|
||||
in-publish "^2.0.0"
|
||||
lodash.assign "^4.2.0"
|
||||
|
|
|
|||
Loading…
Reference in a new issue