Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/components/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import {StyleSheet, View} from 'react-native';
import ActivityIndicator from '@components/ActivityIndicator';
import Icon from '@components/Icon';
import * as Expensicons from '@components/Icon/Expensicons';

Check warning on line 8 in src/components/Button/index.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

'@components/Icon/Expensicons' import is restricted from being used by a pattern. Direct imports from Icon/Expensicons are deprecated. Please use lazy loading hooks instead. Use `useMemoizedLazyExpensifyIcons` from @hooks/useLazyAsset. See docs/LAZY_ICONS_AND_ILLUSTRATIONS.md for details

Check warning on line 8 in src/components/Button/index.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

'@components/Icon/Expensicons' import is restricted from being used. Direct imports from @components/Icon/Expensicons are deprecated. Please use lazy loading hooks instead. Use `useMemoizedLazyExpensifyIcons` from @hooks/useLazyAsset. See docs/LAZY_ICONS_AND_ILLUSTRATIONS.md for details
import type {PressableRef} from '@components/Pressable/GenericPressable/types';
import PressableWithFeedback from '@components/Pressable/PressableWithFeedback';
import Text from '@components/Text';
Expand Down Expand Up @@ -101,6 +101,9 @@
/** Additional text styles when the button is hovered */
textHoverStyles?: StyleProp<TextStyle>;

/** The number of lines to display for the primary text */
primaryTextNumberOfLines?: number;

/** Whether we should use the default hover style */
shouldUseDefaultHover?: boolean;

Expand Down Expand Up @@ -262,6 +265,7 @@
innerStyles = [],
textStyles = [],
textHoverStyles = [],
primaryTextNumberOfLines = 1,

shouldUseDefaultHover = true,
hoverStyles = undefined,
Expand Down Expand Up @@ -301,8 +305,9 @@

const primaryText = (
<Text
numberOfLines={1}
numberOfLines={primaryTextNumberOfLines}
style={[
primaryTextNumberOfLines !== 1 && styles.breakAll,
isLoading && styles.opacity0,
styles.pointerEventsNone,
styles.buttonText,
Expand Down
5 changes: 5 additions & 0 deletions src/components/ReportActionItem/ActionableItemButtons.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import {View} from 'react-native';
import type {StyleProp, TextStyle} from 'react-native';
import Button from '@components/Button';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
Expand All @@ -17,6 +18,8 @@ type ActionableItemButtonsProps = {
items: ActionableItem[];
layout?: 'horizontal' | 'vertical';
shouldUseLocalization?: boolean;
primaryTextNumberOfLines?: number;
textStyles?: StyleProp<TextStyle>;
};

function ActionableItemButtons(props: ActionableItemButtonsProps) {
Expand All @@ -32,6 +35,8 @@ function ActionableItemButtons(props: ActionableItemButtonsProps) {
text={props.shouldUseLocalization ? translate(item.text as TranslationPaths) : item.text}
medium
success={item.isPrimary}
primaryTextNumberOfLines={props.primaryTextNumberOfLines}
textStyles={props.textStyles}
/>
))}
</View>
Expand Down
6 changes: 5 additions & 1 deletion src/pages/home/report/PureReportActionItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import Hoverable from '@components/Hoverable';
import MentionReportContext from '@components/HTMLEngineProvider/HTMLRenderers/MentionReportRenderer/MentionReportContext';
import Icon from '@components/Icon';
import {Eye} from '@components/Icon/Expensicons';

Check warning on line 17 in src/pages/home/report/PureReportActionItem.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

'@components/Icon/Expensicons' import is restricted from being used by a pattern. Direct imports from Icon/Expensicons are deprecated. Please use lazy loading hooks instead. Use `useMemoizedLazyExpensifyIcons` from @hooks/useLazyAsset. See docs/LAZY_ICONS_AND_ILLUSTRATIONS.md for details

Check warning on line 17 in src/pages/home/report/PureReportActionItem.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

'@components/Icon/Expensicons' import is restricted from being used. Direct imports from @components/Icon/Expensicons are deprecated. Please use lazy loading hooks instead. Use `useMemoizedLazyExpensifyIcons` from @hooks/useLazyAsset. See docs/LAZY_ICONS_AND_ILLUSTRATIONS.md for details
import InlineSystemMessage from '@components/InlineSystemMessage';
import KYCWall from '@components/KYCWall';
import {KYCWallContext} from '@components/KYCWall/KYCWallContext';
Expand Down Expand Up @@ -1493,6 +1493,8 @@
} else {
const hasBeenFlagged =
![CONST.MODERATION.MODERATOR_DECISION_APPROVED, CONST.MODERATION.MODERATOR_DECISION_PENDING].some((item) => item === moderationDecision) && !isPendingRemove(action);

const isConciergeOptions = isConciergeCategoryOptions(action) || isConciergeDescriptionOptions(action);
children = (
<MentionReportContext.Provider value={mentionReportContextValue}>
<ShowContextMenuContext.Provider value={contextValue}>
Expand Down Expand Up @@ -1535,7 +1537,9 @@
? 'vertical'
: 'horizontal'
}
shouldUseLocalization={!isConciergeCategoryOptions(action) && !isConciergeDescriptionOptions(action)}
shouldUseLocalization={!isConciergeOptions}
primaryTextNumberOfLines={isConciergeOptions ? 2 : 1}
textStyles={isConciergeOptions ? styles.textAlignLeft : undefined}
/>
)}
</View>
Expand Down
Loading