diff --git a/client/src/components/BookingList/BookingList.scss b/client/src/components/BookingList/BookingList.scss index 3b682149e04acd108bd0e0638aec47e71d775a39..6f50c49d5973231d5bd3bc401f406882f393ce78 100644 --- a/client/src/components/BookingList/BookingList.scss +++ b/client/src/components/BookingList/BookingList.scss @@ -18,4 +18,4 @@ .booking-bold { font-weight: bold; -} \ No newline at end of file +} diff --git a/client/src/components/BookingList/BookingList.tsx b/client/src/components/BookingList/BookingList.tsx index d87ca26272de8964b993c1020e2ac486afbefc35..0ec62633fabda5b79c471483eabad84753936cfe 100644 --- a/client/src/components/BookingList/BookingList.tsx +++ b/client/src/components/BookingList/BookingList.tsx @@ -33,4 +33,4 @@ function BookingList() { ); } -export default BookingList; \ No newline at end of file +export default BookingList; diff --git a/client/src/components/BookingQuery/BookingQuery.scss b/client/src/components/BookingQuery/BookingQuery.scss index 8615421c262b8140b317299bd38dd624e4bf8cf6..b401cc9981048fe2bf4206e6f4375ca752784583 100644 --- a/client/src/components/BookingQuery/BookingQuery.scss +++ b/client/src/components/BookingQuery/BookingQuery.scss @@ -9,4 +9,4 @@ .booking-query-card { width: 20vw; min-width: 350px; -} \ No newline at end of file +} diff --git a/client/src/components/BookingQuery/BookingQuery.tsx b/client/src/components/BookingQuery/BookingQuery.tsx index 1760725bef35b97609acdafeaa2e1d4953e15716..6f982aa1db6a6c4eccf6721ced80f29a7a14c36f 100644 --- a/client/src/components/BookingQuery/BookingQuery.tsx +++ b/client/src/components/BookingQuery/BookingQuery.tsx @@ -79,4 +79,4 @@ function BookingQuery() { ); } -export default BookingQuery; \ No newline at end of file +export default BookingQuery; diff --git a/client/src/components/Dashboard/FlightCard/FlightCard.tsx b/client/src/components/Dashboard/FlightCard/FlightCard.tsx index 82bb495822744c53a58aefd096dae521cf3311d4..5de50b741fb10ec4215fc824c5c71bea628e538b 100644 --- a/client/src/components/Dashboard/FlightCard/FlightCard.tsx +++ b/client/src/components/Dashboard/FlightCard/FlightCard.tsx @@ -1,5 +1,6 @@ import { Link } from 'react-router-dom'; import { IFlight } from '../../../services/Dashboard/CustomerDashboard'; +import { airportCode } from '../../../helpers/Airports'; import './FlightCard.scss'; interface IFlightCard { @@ -11,7 +12,7 @@ function FlightCard({ flight }: IFlightCard) { <> <div className='flight-card'> <span>{flight.id}</span> - {/* <span className='flight-path'>{flight.origin} - {flight.destination}</span> */} + <span className='flight-path'>{airportCode(flight.origin)} - {airportCode(flight.destination)}</span> <span>{flight.origin} - {flight.destination}</span> <Link to={'/flights/' + flight.id}>View Flight</Link> </div> diff --git a/client/src/helpers/Airports.ts b/client/src/helpers/Airports.ts index 7969723f553092287d2e62c9eed44f6ff28d8727..8fbf3bc3cc66bc96d6c62b7a283f7b9f1fb4f2da 100644 --- a/client/src/helpers/Airports.ts +++ b/client/src/helpers/Airports.ts @@ -14,3 +14,7 @@ airportMap.set('Liverpool', 'LPL'); airportMap.set('Norwich', 'NWI'); export const airports = [...airportMap.keys()]; + +export function airportCode(airport: string): string { + return airportMap.get(airport) ?? 'unknown'; +}; \ No newline at end of file