File size: 2,994 Bytes
f5071ca
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import React from 'react';
import SpotMapContainer from '../spot_map_container';
import ShowSplash from './show_splash';
import SpotDetail from './spot_detail';import SpotPhotos from './spot_photos';
import SpotAmenities from './spot_amenities';
import Location from './location';
import NavBarIndexContainer from '../../search/navbar_index/navbar_index_container';
import HostInfo from './host_info';
import MiniHostInfo from './mini_host_info';
import SpotAd from './spot_ad';
import BookingForm from '../../booking/booking_form';
import BookingFormContainer from '../../booking/booking_form_container';
import BookingFooterContainer from '../../booking/booking_footer_container';
// import BookingFooter from '../../booking/booking_footer';


class SpotShow extends React.Component{
    constructor(props){
        super(props)
    }


    componentDidMount() {
     
        this.props.fetchSpot(this.props.match.params.spotId);
    }

    render() {

        if(!this.props.spot) return null;

        const spot = this.props.spot;
        return(
            <div className="spot-show-main">

                <div>
                    <NavBarIndexContainer/>
                </div>

                <div>
                    <ShowSplash
                        spot={this.props.spot}/>
                </div>

                <div className="show-bottom">
                    <div className="spot-host">
                        <div>
                            <SpotDetail
                                spot={this.props.spot}/>
                        </div>

                        <div>
                            <BookingFormContainer
                                spot={this.props.spot}
                                />
                        </div>

                        {/* <div>
                            <MiniHostInfo
                                host={this.props.host}/>
                        </div> */}
                    </div>

                    <div>
                        <SpotPhotos
                            photoUrls={this.props.spot.photoUrls}/>
                    </div>

                    <div>
                        <SpotAd/>
                    </div>

                    <div>
                        <SpotAmenities/>
                    </div>

                    {/* <div>
                        <HostInfo
                            host={this.props.host}/>
                    </div> */}

                    <div>
                        <Location
                            location={this.props.spot.location}
                            loc_detail={this.props.spot.loc_detail}/>
                    </div>

                    <div className="show-footer">
                        <div className="booking-button-container">
                            <BookingFooterContainer/>
                        </div>
                    </div>
                </div>

            </div>
        )
    }
}

export default SpotShow;