Skip to content

Commit

Permalink
Merge pull request #42864 from rushatgabhane/travel-demo
Browse files Browse the repository at this point in the history
[VIP][Travel] Add book travel demo button
  • Loading branch information
iwiznia authored Jun 3, 2024
2 parents 7dcfddf + d9656ca commit 8c20932
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3296,6 +3296,7 @@ const CONST = {
},

CONCIERGE_TRAVEL_URL: 'https://community.expensify.com/discussion/7066/introducing-concierge-travel',
BOOK_TRAVEL_DEMO_URL: 'https://calendly.com/d/ck2z-xsh-q97/expensify-travel-demo-travel-page',
SCREEN_READER_STATES: {
ALL: 'all',
ACTIVE: 'active',
Expand Down
21 changes: 21 additions & 0 deletions src/components/FeatureList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ type FeatureListProps = {
/** Action to call on cta button press */
onCtaPress?: () => void;

/** Text of the secondary button button */
secondaryButtonText?: string;

/** Accessibility label for the secondary button */
secondaryButtonAccessibilityLabel?: string;

/** Action to call on secondary button press */
onSecondaryButtonPress?: () => void;

/** A list of menuItems representing the feature list. */
menuItems: FeatureListItem[];

Expand All @@ -57,6 +66,9 @@ function FeatureList({
ctaText = '',
ctaAccessibilityLabel = '',
onCtaPress,
secondaryButtonText = '',
secondaryButtonAccessibilityLabel = '',
onSecondaryButtonPress,
menuItems,
illustration,
illustrationStyle,
Expand Down Expand Up @@ -99,6 +111,15 @@ function FeatureList({
</View>
))}
</View>
{secondaryButtonText && (
<Button
text={secondaryButtonText}
onPress={onSecondaryButtonPress}
accessibilityLabel={secondaryButtonAccessibilityLabel}
style={[styles.w100, styles.mb3]}
large
/>
)}
<Button
text={ctaText}
onPress={onCtaPress}
Expand Down
1 change: 1 addition & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1868,6 +1868,7 @@ export default {
alerts: 'Get realtime updates and alerts',
},
bookTravel: 'Book travel',
bookDemo: 'Book demo',
termsAndConditions: {
header: 'Before we continue...',
title: 'Please read the Terms & Conditions for travel',
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1892,6 +1892,7 @@ export default {
alerts: 'Obtén actualizaciones y alertas en tiempo real',
},
bookTravel: 'Reservar viajes',
bookDemo: 'Pedir demostración',
termsAndConditions: {
header: 'Antes de continuar...',
title: 'Por favor, lee los Términos y condiciones para reservar viajes',
Expand Down
10 changes: 9 additions & 1 deletion src/pages/Travel/ManageTrips.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import {View} from 'react-native';
import {Linking, View} from 'react-native';
import type {FeatureListItem} from '@components/FeatureList';
import FeatureList from '@components/FeatureList';
import * as Illustrations from '@components/Icon/Illustrations';
Expand All @@ -10,6 +10,7 @@ import useThemeStyles from '@hooks/useThemeStyles';
import useWindowDimensions from '@hooks/useWindowDimensions';
import Navigation from '@libs/Navigation/Navigation';
import colors from '@styles/theme/colors';
import CONST from '@src/CONST';
import ROUTES from '@src/ROUTES';
import getTripIllustrationStyle from './getTripIllustrationStyle';

Expand All @@ -30,6 +31,10 @@ function ManageTrips() {
const {translate} = useLocalize();
const illustrationStyle = getTripIllustrationStyle();

const navigateToBookTravelDemo = () => {
Linking.openURL(CONST.BOOK_TRAVEL_DEMO_URL);
};

return (
<ScrollView contentContainerStyle={styles.pt3}>
<View style={[styles.flex1, isSmallScreenWidth ? styles.workspaceSectionMobile : styles.workspaceSection]}>
Expand All @@ -42,6 +47,9 @@ function ManageTrips() {
onCtaPress={() => {
Navigation.navigate(ROUTES.TRAVEL_TCS);
}}
secondaryButtonText={translate('travel.bookDemo')}
secondaryButtonAccessibilityLabel={translate('travel.bookDemo')}
onSecondaryButtonPress={navigateToBookTravelDemo}
illustration={LottieAnimations.Plane}
illustrationStyle={illustrationStyle}
illustrationBackgroundColor={colors.blue600}
Expand Down

0 comments on commit 8c20932

Please sign in to comment.