Skip to content

Commit

Permalink
feat: Added GlobalMessage to TripSearchScreen
Browse files Browse the repository at this point in the history
  • Loading branch information
strandlie committed Jan 13, 2025
1 parent 8670332 commit db0d9f4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/global-messages/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export enum GlobalMessageContextEnum {
appFareContractDetails = 'app-fare-contract-details',
appDepartureDetails = 'app-departure-details',
appTripDetails = 'app-trip-details',
appTripResults = 'app-trip-results',
appServiceDisruptions = 'app-service-disruptions',
appLogin = 'app-login',
appLoginPhone = 'app-login-phone',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import {useIsFocusedAndActive} from '@atb/utils/use-is-focused-and-active';
import {usePopOverContext} from '@atb/popover';
import {areDefaultFiltersSelected} from './utils';
import {useFeatureTogglesContext} from '@atb/feature-toggles';
import {GlobalMessage, GlobalMessageContextEnum} from '@atb/global-messages';

type RootProps = DashboardScreenProps<'Dashboard_TripSearchScreen'>;

Expand Down Expand Up @@ -404,6 +405,18 @@ export const Dashboard_TripSearchScreen: React.FC<RootProps> = ({
{t(TripSearchTexts.searchState.noResultReason.MissingLocation)}
</ThemeText>
)}
{!!tripPatterns.length && (
<View style={styles.globalMessage}>
<GlobalMessage
textColor={theme.color.background.neutral[0]}
globalMessageContext={GlobalMessageContextEnum.appTripResults}
ruleVariables={{
fromStopPlaceId: from?.id ?? '',
toStopPlaceId: to?.id ?? '',
}}
/>
</View>
)}
{from && to && (
<View>
{filtersState.enabled && (
Expand Down Expand Up @@ -682,4 +695,8 @@ const useStyles = StyleSheet.createThemeHook((theme) => ({
emptyResultsSpacer: {
marginTop: theme.spacing.xLarge * 3,
},
globalMessage: {
paddingHorizontal: theme.spacing.medium,
paddingTop: theme.spacing.medium,
},
}));

0 comments on commit db0d9f4

Please sign in to comment.