Skip to content
Snippets Groups Projects
Commit c9f94370 authored by lcross2002's avatar lcross2002
Browse files

fix dashboard flight card + formatting

parent cf42d76f
No related branches found
No related tags found
No related merge requests found
...@@ -18,4 +18,4 @@ ...@@ -18,4 +18,4 @@
.booking-bold { .booking-bold {
font-weight: bold; font-weight: bold;
} }
\ No newline at end of file
...@@ -33,4 +33,4 @@ function BookingList() { ...@@ -33,4 +33,4 @@ function BookingList() {
); );
} }
export default BookingList; export default BookingList;
\ No newline at end of file
...@@ -9,4 +9,4 @@ ...@@ -9,4 +9,4 @@
.booking-query-card { .booking-query-card {
width: 20vw; width: 20vw;
min-width: 350px; min-width: 350px;
} }
\ No newline at end of file
...@@ -79,4 +79,4 @@ function BookingQuery() { ...@@ -79,4 +79,4 @@ function BookingQuery() {
); );
} }
export default BookingQuery; export default BookingQuery;
\ No newline at end of file
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { IFlight } from '../../../services/Dashboard/CustomerDashboard'; import { IFlight } from '../../../services/Dashboard/CustomerDashboard';
import { airportCode } from '../../../helpers/Airports';
import './FlightCard.scss'; import './FlightCard.scss';
interface IFlightCard { interface IFlightCard {
...@@ -11,7 +12,7 @@ function FlightCard({ flight }: IFlightCard) { ...@@ -11,7 +12,7 @@ function FlightCard({ flight }: IFlightCard) {
<> <>
<div className='flight-card'> <div className='flight-card'>
<span>{flight.id}</span> <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> <span>{flight.origin} - {flight.destination}</span>
<Link to={'/flights/' + flight.id}>View Flight</Link> <Link to={'/flights/' + flight.id}>View Flight</Link>
</div> </div>
......
...@@ -14,3 +14,7 @@ airportMap.set('Liverpool', 'LPL'); ...@@ -14,3 +14,7 @@ airportMap.set('Liverpool', 'LPL');
airportMap.set('Norwich', 'NWI'); airportMap.set('Norwich', 'NWI');
export const airports = [...airportMap.keys()]; export const airports = [...airportMap.keys()];
export function airportCode(airport: string): string {
return airportMap.get(airport) ?? 'unknown';
};
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment