diff --git a/app/components/post_body/post_body.js b/app/components/post_body/post_body.js index bd01e7d18..733834afa 100644 --- a/app/components/post_body/post_body.js +++ b/app/components/post_body/post_body.js @@ -20,7 +20,7 @@ import OptionsContext from 'app/components/options_context'; import PostBodyAdditionalContent from 'app/components/post_body_additional_content'; import {emptyFunction} from 'app/utils/general'; -import {getMarkdownTextStyles, getMarkdownBlockStyles, normalizeFontSizeByDevice} from 'app/utils/markdown'; +import {getMarkdownTextStyles, getMarkdownBlockStyles} from 'app/utils/markdown'; import {makeStyleSheetFromTheme} from 'app/utils/theme'; import Reactions from 'app/components/reactions'; @@ -314,8 +314,8 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => { return { message: { color: theme.centerChannelColor, - fontSize: normalizeFontSizeByDevice(13), - lineHeight: normalizeFontSizeByDevice(16), + fontSize: 15, + lineHeight: 20, }, messageContainerWithReplyBar: { flexDirection: 'row', diff --git a/app/utils/markdown.js b/app/utils/markdown.js index f1c8c2ae8..678e2a2cc 100644 --- a/app/utils/markdown.js +++ b/app/utils/markdown.js @@ -1,20 +1,13 @@ // Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -import {Dimensions, PixelRatio, Platform, StyleSheet} from 'react-native'; +import {Platform, StyleSheet} from 'react-native'; import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; export function getCodeFont() { return Platform.OS === 'ios' ? 'Menlo' : 'monospace'; } -const portraitWidth = Dimensions.get('window').width <= Dimensions.get('window').height ? Dimensions.get('window').width : Dimensions.get('window').height; -const scale = portraitWidth / 320; - -export const normalizeFontSizeByDevice = (size) => { - return Math.ceil(PixelRatio.roundToNearestPixel(size * scale)); -}; - export const getMarkdownTextStyles = makeStyleSheetFromTheme((theme) => { const codeFont = getCodeFont(); @@ -32,52 +25,52 @@ export const getMarkdownTextStyles = makeStyleSheetFromTheme((theme) => { color: theme.linkColor, }, heading1: { - fontSize: normalizeFontSizeByDevice(16), + fontSize: 17, fontWeight: '700', - lineHeight: normalizeFontSizeByDevice(22), + lineHeight: 25, }, heading1Text: { - paddingBottom: normalizeFontSizeByDevice(6), + paddingBottom: 8, }, heading2: { - fontSize: normalizeFontSizeByDevice(16), + fontSize: 17, fontWeight: '700', - lineHeight: normalizeFontSizeByDevice(22), + lineHeight: 25, }, heading2Text: { - paddingBottom: normalizeFontSizeByDevice(6), + paddingBottom: 8, }, heading3: { - fontSize: normalizeFontSizeByDevice(16), + fontSize: 17, fontWeight: '700', - lineHeight: normalizeFontSizeByDevice(22), + lineHeight: 25, }, heading3Text: { - paddingBottom: normalizeFontSizeByDevice(6), + paddingBottom: 8, }, heading4: { - fontSize: normalizeFontSizeByDevice(16), + fontSize: 17, fontWeight: '700', - lineHeight: normalizeFontSizeByDevice(22), + lineHeight: 25, }, heading4Text: { - paddingBottom: normalizeFontSizeByDevice(6), + paddingBottom: 8, }, heading5: { - fontSize: normalizeFontSizeByDevice(16), + fontSize: 17, fontWeight: '700', - lineHeight: normalizeFontSizeByDevice(22), + lineHeight: 25, }, heading5Text: { - paddingBottom: normalizeFontSizeByDevice(6), + paddingBottom: 8, }, heading6: { - fontSize: normalizeFontSizeByDevice(16), + fontSize: 17, fontWeight: '700', - lineHeight: normalizeFontSizeByDevice(22), + lineHeight: 25, }, heading6Text: { - paddingBottom: normalizeFontSizeByDevice(6), + paddingBottom: 8, }, code: { alignSelf: 'center',