import React from 'react'; import BookingUser from '../booking/booking_user'; import BookingIndexItem from '../booking/booking_index_item'; import NavBarIndexContainer from '../search/navbar_index/navbar_index_container'; class UserShow extends React.Component { constructor(props) { super(props); } componentDidMount() { this.props.fetchUser(this.props.userId); } render() { if (this.props.userId === undefined) return null; if (this.props.user === undefined) return null; if (this.props.bookings === undefined) return null; if (this.props.spots === undefined) return null; const bookings = this.props.bookings.map(booking => { let spot = undefined; this.props.spots.forEach(potentialSpot => { if (booking.spot_id === potentialSpot.id) { spot = potentialSpot; } }) return ( ) }); return (
Your Bookings
    {bookings}
); } } export default UserShow;