Skip to content

Commit

Permalink
Merge pull request #41659 from rushatgabhane/trip-room-2
Browse files Browse the repository at this point in the history
[VIP-Travel] Trip room summary
  • Loading branch information
stitesExpensify authored Jun 4, 2024
2 parents 70d36c6 + f23f0c1 commit 594ae48
Show file tree
Hide file tree
Showing 17 changed files with 466 additions and 27 deletions.
1 change: 1 addition & 0 deletions assets/images/bed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/images/car-with-key.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/images/plane.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const KEYBOARD_SHORTCUT_NAVIGATION_TYPE = 'NAVIGATION_SHORTCUT';
const chatTypes = {
POLICY_ANNOUNCE: 'policyAnnounce',
POLICY_ADMINS: 'policyAdmins',
TRIP_ROOM: 'tripRoom',
GROUP: 'group',
DOMAIN_ALL: 'domainAll',
POLICY_ROOM: 'policyRoom',
Expand Down Expand Up @@ -698,6 +699,7 @@ const CONST = {
TASK_COMPLETED: 'TASKCOMPLETED',
TASK_EDITED: 'TASKEDITED',
TASK_REOPENED: 'TASKREOPENED',
TRIPPREVIEW: 'TRIPPREVIEW',
UNAPPROVED: 'UNAPPROVED', // OldDot Action
UNHOLD: 'UNHOLD',
UNSHARE: 'UNSHARE', // OldDot Action
Expand Down Expand Up @@ -4752,6 +4754,12 @@ const CONST = {
INITIAL_URL: 'INITIAL_URL',
},

RESERVATION_TYPE: {
CAR: 'car',
HOTEL: 'hotel',
FLIGHT: 'flight',
},

DOT_SEPARATOR: '•',

DEFAULT_TAX: {
Expand Down
6 changes: 6 additions & 0 deletions src/components/Icon/Expensicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import NotificationsAvatar from '@assets/images/avatars/notifications-avatar.svg
import ActiveRoomAvatar from '@assets/images/avatars/room.svg';
import BackArrow from '@assets/images/back-left.svg';
import Bank from '@assets/images/bank.svg';
import Bed from '@assets/images/bed.svg';
import Bell from '@assets/images/bell.svg';
import BellSlash from '@assets/images/bellSlash.svg';
import Bill from '@assets/images/bill.svg';
Expand All @@ -28,6 +29,7 @@ import Bug from '@assets/images/bug.svg';
import Building from '@assets/images/building.svg';
import Calendar from '@assets/images/calendar.svg';
import Camera from '@assets/images/camera.svg';
import CarWithKey from '@assets/images/car-with-key.svg';
import Car from '@assets/images/car.svg';
import CardsAndDomains from '@assets/images/cards-and-domains.svg';
import Cash from '@assets/images/cash.svg';
Expand Down Expand Up @@ -127,6 +129,7 @@ import Paycheck from '@assets/images/paycheck.svg';
import Pencil from '@assets/images/pencil.svg';
import Phone from '@assets/images/phone.svg';
import Pin from '@assets/images/pin.svg';
import Plane from '@assets/images/plane.svg';
import Play from '@assets/images/play.svg';
import Plus from '@assets/images/plus.svg';
import Printer from '@assets/images/printer.svg';
Expand Down Expand Up @@ -348,6 +351,9 @@ export {
ChatBubbleUnread,
ChatBubbleReply,
Lightbulb,
Plane,
Bed,
CarWithKey,
DocumentPlus,
Clear,
CheckCircle,
Expand Down
71 changes: 44 additions & 27 deletions src/components/MenuItem.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ExpensiMark from 'expensify-common/lib/ExpensiMark';
import type {ImageContentFit} from 'expo-image';
import type {ReactNode} from 'react';
import type {ReactElement, ReactNode} from 'react';
import React, {forwardRef, useContext, useMemo} from 'react';
import type {GestureResponderEvent, StyleProp, TextStyle, ViewStyle} from 'react-native';
import {View} from 'react-native';
Expand Down Expand Up @@ -105,6 +105,9 @@ type MenuItemBaseProps = {
/** The fill color to pass into the secondary icon. */
secondaryIconFill?: string;

/** Whether the secondary icon should have hover style */
isSecondaryIconHoverable?: boolean;

/** Icon Width */
iconWidth?: number;

Expand Down Expand Up @@ -182,6 +185,12 @@ type MenuItemBaseProps = {
/** Text to display for the item */
title?: string;

/** Component to display as the title */
titleComponent?: ReactElement;

/** Any additional styles to apply to the container for title components */
titleContainerStyle?: StyleProp<ViewStyle>;

/** A right-aligned subtitle for this menu option */
subtitle?: string | number;

Expand Down Expand Up @@ -300,6 +309,7 @@ function MenuItem(
secondaryIcon,
secondaryIconFill,
iconType = CONST.ICON_TYPE_ICON,
isSecondaryIconHoverable = false,
iconWidth,
iconHeight,
iconStyles,
Expand All @@ -321,6 +331,8 @@ function MenuItem(
focused = false,
disabled = false,
title,
titleComponent,
titleContainerStyle,
subtitle,
shouldShowBasicTitle,
label,
Expand Down Expand Up @@ -554,7 +566,7 @@ function MenuItem(
</View>
)}
{secondaryIcon && (
<View style={[styles.popoverMenuIcon, iconStyles]}>
<View style={[styles.popoverMenuIcon, iconStyles, isSecondaryIconHoverable && StyleUtils.getBackgroundAndBorderStyle(theme.border)]}>
<Icon
contentFit={contentFit}
src={secondaryIcon}
Expand All @@ -567,7 +579,9 @@ function MenuItem(
/>
</View>
)}
<View style={[styles.justifyContentCenter, styles.flex1, StyleUtils.getMenuItemTextContainerStyle(isSmallAvatarSubscriptMenu)]}>
<View
style={[styles.justifyContentCenter, styles.flex1, StyleUtils.getMenuItemTextContainerStyle(isSmallAvatarSubscriptMenu), titleContainerStyle]}
>
{!!description && shouldShowDescriptionOnTop && (
<Text
style={descriptionTextStyles}
Expand All @@ -576,30 +590,32 @@ function MenuItem(
{description}
</Text>
)}
<View style={[styles.flexRow, styles.alignItemsCenter]}>
{!!title && (shouldRenderAsHTML || (shouldParseTitle && !!html.length)) && (
<View style={styles.renderHTMLTitle}>
<RenderHTML html={processedTitle} />
</View>
)}
{!shouldRenderAsHTML && !shouldParseTitle && !!title && (
<Text
style={combinedTitleTextStyle}
numberOfLines={numberOfLinesTitle || undefined}
dataSet={{[CONST.SELECTION_SCRAPER_HIDDEN_ELEMENT]: interactive && disabled}}
>
{renderTitleContent()}
</Text>
)}
{shouldShowTitleIcon && titleIcon && (
<View style={[styles.ml2]}>
<Icon
src={titleIcon}
fill={theme.iconSuccessFill}
/>
</View>
)}
</View>
{(!!title || !!shouldShowTitleIcon) && (
<View style={[styles.flexRow, styles.alignItemsCenter]}>
{!!title && (shouldRenderAsHTML || (shouldParseTitle && !!html.length)) && (
<View style={styles.renderHTMLTitle}>
<RenderHTML html={processedTitle} />
</View>
)}
{!shouldRenderAsHTML && !shouldParseTitle && !!title && (
<Text
style={combinedTitleTextStyle}
numberOfLines={numberOfLinesTitle || undefined}
dataSet={{[CONST.SELECTION_SCRAPER_HIDDEN_ELEMENT]: interactive && disabled}}
>
{renderTitleContent()}
</Text>
)}
{shouldShowTitleIcon && titleIcon && (
<View style={[styles.ml2]}>
<Icon
src={titleIcon}
fill={theme.iconSuccessFill}
/>
</View>
)}
</View>
)}
{!!description && !shouldShowDescriptionOnTop && (
<Text
style={descriptionTextStyles}
Expand All @@ -626,6 +642,7 @@ function MenuItem(
</Text>
</View>
)}
{titleComponent}
</View>
</View>
</View>
Expand Down
Loading

0 comments on commit 594ae48

Please sign in to comment.