Skip to content

Commit

Permalink
Merge pull request #43595 from Expensify/shawn-fixLabels
Browse files Browse the repository at this point in the history
Fix label style for push rows that are empty
  • Loading branch information
luacmartins authored Jun 13, 2024
2 parents 4d75cb2 + 2fad56e commit 06cde0a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
6 changes: 0 additions & 6 deletions src/components/AmountPicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@ import React, {forwardRef, useState} from 'react';
import type {ForwardedRef} from 'react';
import {View} from 'react-native';
import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription';
import useStyleUtils from '@hooks/useStyleUtils';
import variables from '@styles/variables';
import CONST from '@src/CONST';
import callOrReturn from '@src/types/utils/callOrReturn';
import AmountSelectorModal from './AmountSelectorModal';
import type {AmountPickerProps} from './types';

function AmountPicker({value, description, title, errorText = '', onInputChange, furtherDetails, rightLabel, ...rest}: AmountPickerProps, forwardedRef: ForwardedRef<View>) {
const StyleUtils = useStyleUtils();
const [isPickerVisible, setIsPickerVisible] = useState(false);

const showPickerModal = () => {
Expand All @@ -29,15 +26,12 @@ function AmountPicker({value, description, title, errorText = '', onInputChange,
hidePickerModal();
};

const descStyle = !value || value.length === 0 ? StyleUtils.getFontSizeStyle(variables.fontSizeLabel) : null;

return (
<View>
<MenuItemWithTopDescription
ref={forwardedRef}
shouldShowRightIcon
title={callOrReturn(title, value)}
descriptionTextStyle={descStyle}
description={description}
onPress={showPickerModal}
furtherDetails={furtherDetails}
Expand Down
6 changes: 0 additions & 6 deletions src/components/TextPicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@ import React, {forwardRef, useState} from 'react';
import type {ForwardedRef} from 'react';
import {View} from 'react-native';
import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription';
import useStyleUtils from '@hooks/useStyleUtils';
import useThemeStyles from '@hooks/useThemeStyles';
import variables from '@styles/variables';
import CONST from '@src/CONST';
import TextSelectorModal from './TextSelectorModal';
import type {TextPickerProps} from './types';

function TextPicker({value, description, placeholder = '', errorText = '', onInputChange, furtherDetails, rightLabel, ...rest}: TextPickerProps, forwardedRef: ForwardedRef<View>) {
const styles = useThemeStyles();
const StyleUtils = useStyleUtils();
const [isPickerVisible, setIsPickerVisible] = useState(false);

const showPickerModal = () => {
Expand All @@ -29,15 +26,12 @@ function TextPicker({value, description, placeholder = '', errorText = '', onInp
hidePickerModal();
};

const descStyle = !value || value.length === 0 ? StyleUtils.getFontSizeStyle(variables.fontSizeLabel) : null;

return (
<View>
<MenuItemWithTopDescription
ref={forwardedRef}
shouldShowRightIcon
title={value ?? placeholder ?? ''}
descriptionTextStyle={descStyle}
description={description}
onPress={showPickerModal}
furtherDetails={furtherDetails}
Expand Down

0 comments on commit 06cde0a

Please sign in to comment.