forked from Ivasoft/mattermost-mobile
Reverted changes to normalize font size (#1489)
This commit is contained in:
committed by
Elias Nahum
parent
6293d3d5e4
commit
84db6d0974
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user