diff --git a/app/components/markdown/markdown.tsx b/app/components/markdown/markdown.tsx index d0aa6611d9..0437097154 100644 --- a/app/components/markdown/markdown.tsx +++ b/app/components/markdown/markdown.tsx @@ -39,6 +39,7 @@ import type { type MarkdownProps = { autolinkedUrlSchemes?: string[]; baseTextStyle: StyleProp; + baseParagraphStyle?: StyleProp; blockStyles?: MarkdownBlockStyles; channelId?: string; channelMentions?: ChannelMentions; @@ -85,7 +86,7 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => { return { block: { - alignItems: 'center', + alignItems: 'flex-start', flexDirection: 'row', flexWrap: 'wrap', }, @@ -128,7 +129,7 @@ const Markdown = ({ enableInlineLatex, enableLatex, imagesMetadata, isEdited, isReplyPost, isSearchResult, layoutHeight, layoutWidth, location, mentionKeys, minimumHashtagLength = 3, onPostPress, postId, searchPatterns, - textStyles = {}, theme, value = '', + textStyles = {}, theme, value = '', baseParagraphStyle, }: MarkdownProps) => { const style = getStyleSheet(theme); const managedConfig = useManagedConfig(); @@ -383,11 +384,13 @@ const Markdown = ({ } return ( - + + + ); }; @@ -440,7 +443,9 @@ const Markdown = ({ style={blockStyle} testID='markdown_paragraph' > - {children} + + {children} + ); }; diff --git a/app/components/markdown/markdown_latex_inline/index.tsx b/app/components/markdown/markdown_latex_inline/index.tsx index 0f6fb7af47..be7e6a6973 100644 --- a/app/components/markdown/markdown_latex_inline/index.tsx +++ b/app/components/markdown/markdown_latex_inline/index.tsx @@ -3,7 +3,7 @@ import React from 'react'; import {useIntl} from 'react-intl'; -import {Text, View} from 'react-native'; +import {Platform, Text, View} from 'react-native'; import MathView from 'react-native-math-view'; import ErrorBoundary from '@components/markdown/error_boundary'; @@ -23,6 +23,7 @@ type MathViewErrorProps = { const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => { return { mathStyle: { + marginBottom: Platform.select({default: -10, ios: 2.5}), color: theme.centerChannelColor, }, viewStyle: { diff --git a/app/components/post_list/post/system_message/__snapshots__/system_message_helpers.test.js.snap b/app/components/post_list/post/system_message/__snapshots__/system_message_helpers.test.js.snap index a380fc3aa5..8d44565568 100644 --- a/app/components/post_list/post/system_message/__snapshots__/system_message_helpers.test.js.snap +++ b/app/components/post_list/post/system_message/__snapshots__/system_message_helpers.test.js.snap @@ -12,7 +12,7 @@ exports[`renderSystemMessage uses renderer for Channel Display Name update 1`] = style={ [ { - "alignItems": "center", + "alignItems": "flex-start", "flexDirection": "row", "flexWrap": "wrap", }, @@ -20,42 +20,44 @@ exports[`renderSystemMessage uses renderer for Channel Display Name update 1`] = } testID="markdown_paragraph" > - + + + @username + + + - - @username - - - - updated the channel display name from: old displayname to: new displayname + testID="markdown_text" + > + updated the channel display name from: old displayname to: new displayname + @@ -73,7 +75,7 @@ exports[`renderSystemMessage uses renderer for Channel Header update 1`] = ` style={ [ { - "alignItems": "center", + "alignItems": "flex-start", "flexDirection": "row", "flexWrap": "wrap", }, @@ -81,42 +83,44 @@ exports[`renderSystemMessage uses renderer for Channel Header update 1`] = ` } testID="markdown_paragraph" > - + + + @username + + + - - @username - - - - updated the channel header from: old header to: new header + testID="markdown_text" + > + updated the channel header from: old header to: new header + @@ -150,7 +154,7 @@ exports[`renderSystemMessage uses renderer for Guest added and join to channel 1 style={ [ { - "alignItems": "center", + "alignItems": "flex-start", "flexDirection": "row", "flexWrap": "wrap", }, @@ -158,42 +162,44 @@ exports[`renderSystemMessage uses renderer for Guest added and join to channel 1 } testID="markdown_paragraph" > - + + + @username + + + - - @username - - - - joined the channel as a guest. + testID="markdown_text" + > + joined the channel as a guest. + @@ -211,7 +217,7 @@ exports[`renderSystemMessage uses renderer for Guest added and join to channel 2 style={ [ { - "alignItems": "center", + "alignItems": "flex-start", "flexDirection": "row", "flexWrap": "wrap", }, @@ -219,63 +225,65 @@ exports[`renderSystemMessage uses renderer for Guest added and join to channel 2 } testID="markdown_paragraph" > - + - @other.user - - - - added to the channel as a guest by - - + + @other.user + + + - - @username. + added to the channel as a guest by + + + + @username. + @@ -294,7 +302,7 @@ exports[`renderSystemMessage uses renderer for OLD archived channel without a us style={ [ { - "alignItems": "center", + "alignItems": "flex-start", "flexDirection": "row", "flexWrap": "wrap", }, @@ -302,20 +310,22 @@ exports[`renderSystemMessage uses renderer for OLD archived channel without a us } testID="markdown_paragraph" > - + - archived the channel + testID="markdown_text" + > + archived the channel + @@ -333,7 +343,7 @@ exports[`renderSystemMessage uses renderer for archived channel 1`] = ` style={ [ { - "alignItems": "center", + "alignItems": "flex-start", "flexDirection": "row", "flexWrap": "wrap", }, @@ -341,42 +351,44 @@ exports[`renderSystemMessage uses renderer for archived channel 1`] = ` } testID="markdown_paragraph" > - + + + @username + + + - - @username - - - - archived the channel + testID="markdown_text" + > + archived the channel + @@ -394,7 +406,7 @@ exports[`renderSystemMessage uses renderer for unarchived channel 1`] = ` style={ [ { - "alignItems": "center", + "alignItems": "flex-start", "flexDirection": "row", "flexWrap": "wrap", }, @@ -402,42 +414,44 @@ exports[`renderSystemMessage uses renderer for unarchived channel 1`] = ` } testID="markdown_paragraph" > - + + + @username + + + - - @username - - - - unarchived the channel + testID="markdown_text" + > + unarchived the channel + diff --git a/app/screens/permalink/permalink_error.tsx b/app/screens/permalink/permalink_error.tsx index 052f6f93ab..f0eea69397 100644 --- a/app/screens/permalink/permalink_error.tsx +++ b/app/screens/permalink/permalink_error.tsx @@ -42,6 +42,9 @@ const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => { color: theme.centerChannelColor, ...typography('Body', 200, 'Regular'), }, + errorTextParagraph: { + textAlign: 'center', + }, errorButtonContainer: { borderTopWidth: 1, borderTopColor: changeOpacity(theme.centerChannelColor, 0.16), @@ -128,6 +131,7 @@ function PermalinkError({ theme={theme} value={text} baseTextStyle={style.errorText} + baseParagraphStyle={style.errorTextParagraph} disableAtMentions={true} disableAtChannelMentionHighlight={true} disableChannelLink={true} diff --git a/app/utils/markdown/index.ts b/app/utils/markdown/index.ts index 31b7a24a50..ca0d283d54 100644 --- a/app/utils/markdown/index.ts +++ b/app/utils/markdown/index.ts @@ -30,7 +30,6 @@ export const getMarkdownTextStyles = makeStyleSheetFromTheme((theme: Theme) => { }, strong: { fontFamily: 'OpenSans-SemiBold', - fontWeight: '600', }, del: { textDecorationLine: 'line-through',