Skip to content

Commit

Permalink
Merge pull request #15319 from allroundexperts/fix-14148
Browse files Browse the repository at this point in the history
feat: added conditional styles for chat focus mode
  • Loading branch information
chiragsalian authored Mar 17, 2023
2 parents 0b24114 + 9cab69d commit a00e18d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/LHNOptionsList/OptionRowLHN.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
View,
StyleSheet,
} from 'react-native';
import * as optionRowStyles from '../../styles/optionRowStyles';
import styles from '../../styles/styles';
import * as StyleUtils from '../../styles/StyleUtils';
import Icon from '../Icon';
Expand Down Expand Up @@ -75,7 +76,7 @@ const OptionRowLHN = (props) => {
? [textStyle, styles.optionAlternateText, styles.textLabelSupporting, styles.optionAlternateTextCompact, styles.ml2]
: [textStyle, styles.optionAlternateText, styles.textLabelSupporting], props.style);
const contentContainerStyles = props.viewMode === CONST.OPTION_MODE.COMPACT
? [styles.flex1, styles.flexRow, styles.overflowHidden, styles.alignItemsCenter]
? [styles.flex1, styles.flexRow, styles.overflowHidden, optionRowStyles.compactContentContainerStyles]
: [styles.flex1];
const sidebarInnerRowStyle = StyleSheet.flatten(props.viewMode === CONST.OPTION_MODE.COMPACT ? [
styles.chatLinkRowPressable,
Expand Down
8 changes: 8 additions & 0 deletions src/styles/optionRowStyles/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import styles from '../styles';

const compactContentContainerStyles = styles.alignItemsBaseline;

export {
// eslint-disable-next-line import/prefer-default-export
compactContentContainerStyles,
};
15 changes: 15 additions & 0 deletions src/styles/optionRowStyles/index.native.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import styles from '../styles';

/**
* On native platforms, alignItemsBaseline does not work correctly
* in lining the items together. As such, on native platform, we're
* keeping compactContentContainerStyles as it is.
* https://github.com/Expensify/App/issues/14148
*/

const compactContentContainerStyles = styles.alignItemsCenter;

export {
// eslint-disable-next-line import/prefer-default-export
compactContentContainerStyles,
};

0 comments on commit a00e18d

Please sign in to comment.