diff --git a/src/app/(screens)/clEvent.tsx b/src/app/(screens)/clEvent.tsx index ae70c155..3b4cc866 100644 --- a/src/app/(screens)/clEvent.tsx +++ b/src/app/(screens)/clEvent.tsx @@ -8,6 +8,7 @@ import { formatFriendlyDateTime, formatFriendlyDateTimeRange, } from '@/utils/date-utils' +import { isValidRoom } from '@/utils/timetable-utils' import { trackEvent } from '@aptabase/react-native' import { Redirect, useFocusEffect, useNavigation } from 'expo-router' import React, { useCallback } from 'react' @@ -16,7 +17,7 @@ import { Linking, ScrollView, Share, Text, View } from 'react-native' import { createStyleSheet, useStyles } from 'react-native-unistyles' export default function ClEventDetail(): React.JSX.Element { - const { styles } = useStyles(stylesheet) + const { styles, theme } = useStyles(stylesheet) const navigation = useNavigation() const clEvent = useCLParamsStore((state) => state.selectedClEvent) @@ -97,10 +98,25 @@ export default function ClEventDetail(): React.JSX.Element { ]), ...(clEvent?.location != null && clEvent.location !== '' ? [ - { - title: t('pages.event.location'), - value: clEvent.location, - }, + Object.assign( + { + title: t('pages.event.location'), + value: clEvent?.location, + }, + isValidRoom(clEvent.location) + ? { + onPress: () => { + router.dismissTo({ + pathname: '/map', + params: { + room: clEvent?.location, + }, + }) + }, + textColor: theme.colors.primary, + } + : {} + ), ] : []),