Skip to content

Commit

Permalink
flight card added
Browse files Browse the repository at this point in the history
  • Loading branch information
XdithyX committed Dec 8, 2022
1 parent c745497 commit 6c478a9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/components/FlightCards/FlightCards.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ function FlightCards({flight}) {

<div class="service-card">

<h1 className='trainh'>{train.train_name}</h1>
<h1 className='trainh'>{flight.train_name}</h1>
<div className='trainp_div'>
<p className='trainp'>
Date: {train.next_date}
Date: {flight.next_date}
</p>
<p className='trainp'>
Time: {train.train_time}
Time: {flight.flight_time}
</p>
<p className='trainp'>
Cost: {train.cost}
Cost: {flight.cost}
</p>
</div>
</div>
Expand Down
13 changes: 5 additions & 8 deletions src/pages/PlaceDetailPage/PlaceDetailPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import axios from 'axios'
import baseUrl from '../../utils/Urls'
import HotelCards from '../../components/HotelCards/HotelCards'
import TrainCards from '../../components/FlightCards/TrainCards'
import FlightCards from '../../components/FlightCards/FlightCards'
const PlaceDetailPage = () => {
const[placeName,setPlaceName]=useState('')
const[placeImage,setPlaceImage]=useState()
Expand Down Expand Up @@ -92,18 +93,14 @@ const PlaceDetailPage = () => {

</div>
<div className="place__header_name">Flights to {placeName}
<ul>
<div className='train__container'>
{flights.map((flight)=>
flight.to_place_foreign===parseInt(id)?
(<li className='flight_details'>
<p>Flight Name: {flight.flight_name}</p>
<p>Flight Time: {flight.flight_time}</p>
<p>Cost: {flight.cost}</p>
<p>Next Date: {flight.next_date}</p>
</li>):null
(<FlightCards key={flight.id} flight={flight}/>):null
)
}
</ul>
</div>

</div>
<div className="place__header_name">Trains to {placeName}
<div className='train__container'>
Expand Down

0 comments on commit 6c478a9

Please sign in to comment.