Skip to content

Commit

Permalink
fixed atrium location
Browse files Browse the repository at this point in the history
  • Loading branch information
aryan-bhardwaj committed Sep 12, 2024
1 parent 453a26b commit 11ace42
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Components/CurrentEventCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import CustomModal from "./CustomModal"; // Import the custom modal
import AppLoading from "expo-app-loading";
import Colors from "../constants/Colors";

import { formatTime } from "../navigation/DayEvent";
import { formatTime, formatLocation } from "../navigation/DayEvent";

import EvilIcons from "@expo/vector-icons/EvilIcons";

Expand Down Expand Up @@ -70,7 +70,7 @@ const CurrentEventCard = ({
<View style={styles.info}>
<View style={styles.infoItem}>
<EvilIcons name="location" size={26} color={Colors.DARK_BLUE} />
<Text style={styles.infoText}>{location}</Text>
<Text style={styles.infoText}>{formatLocation(location)}</Text>
</View>
<View style={styles.infoItem}>
<EvilIcons name="clock" size={26} color={Colors.DARK_BLUE} />
Expand Down Expand Up @@ -98,7 +98,7 @@ const CurrentEventCard = ({
visible={showModal}
onClose={() => setShowModal(false)}
title={name}
location={location}
location={formatLocation(location)}
time={formatTime(start)}
points={points}
description={description}
Expand Down
10 changes: 9 additions & 1 deletion navigation/DayEvent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ export const formatTime = (timestamp) => {
return formattedTime;
};

export const formatLocation = (location) => {
if (location.includes("Atrium")) {
const locationWords = location.split(' ');
return `${locationWords[1]} ${locationWords[2]}`
}
return location
}

const DayEvent = ({ day, events }) => {
return (
<View style={styles.container}>
Expand All @@ -31,7 +39,7 @@ const DayEvent = ({ day, events }) => {
key={event.id}
name={event.name}
time={formatTime(event.startTime)}
location={event.location}
location={formatLocation(event.location)}
description={event.description}
points={event.points}
/>
Expand Down

0 comments on commit 11ace42

Please sign in to comment.