Skip to content

Commit

Permalink
handle text overflow on native
Browse files Browse the repository at this point in the history
  • Loading branch information
rushatgabhane committed May 30, 2024
1 parent a6fc886 commit 56ed4e1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/ReportActionItem/TripDetailsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import OfflineWithFeedback from '@components/OfflineWithFeedback';
import SpacerView from '@components/SpacerView';
import Text from '@components/Text';
import useLocalize from '@hooks/useLocalize';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import DateUtils from '@libs/DateUtils';
Expand All @@ -31,6 +32,7 @@ type ReservationViewProps = {
function ReservationView({reservation}: ReservationViewProps) {
const theme = useTheme();
const styles = useThemeStyles();
const {shouldUseNarrowLayout} = useResponsiveLayout();

const reservationIcon = TripReservationUtils.getTripReservationIcon(reservation.type);

Expand Down Expand Up @@ -79,14 +81,14 @@ function ReservationView({reservation}: ReservationViewProps) {
return (
<View style={styles.gap1}>
<View style={[styles.flexRow, styles.alignItemsCenter, styles.gap2]}>
<Text style={[styles.textNormalBold, styles.lh20]}>{formatAirportInfo(reservation.start)}</Text>
<Text style={[styles.textNormalBold, styles.lh20, shouldUseNarrowLayout && styles.flex1]}>{formatAirportInfo(reservation.start)}</Text>
<Icon
src={Expensicons.ArrowRightLong}
width={variables.iconSizeSmall}
height={variables.iconSizeSmall}
fill={theme.icon}
/>
<Text style={[styles.textNormalBold, styles.lh20]}>{formatAirportInfo(reservation.end)}</Text>
<Text style={[styles.textNormalBold, styles.lh20, shouldUseNarrowLayout && styles.flex1]}>{formatAirportInfo(reservation.end)}</Text>
</View>
{bottomDescription && <Text style={[styles.textSupportingSmallSize, styles.lh14]}>{bottomDescription}</Text>}
</View>
Expand Down

0 comments on commit 56ed4e1

Please sign in to comment.