Hospitality

const Venue = ({data}) => { const { name, image, capacity, style, room, content, virtual_link, location } = data; const url = `https://hospitalityservices.aut.ac.nz/contact?room=${room}&style=${style}`; const virtual_link_contents = () => { const { virtual_link } = data; if(virtual_link){ return (
Virtual tour
); } return (
); } return (

{name}

Capacity {capacity}
Style {style}
Room no {room}
{virtual_link_contents()}
{content}
); };const url = `https://hospitalityservices.aut.ac.nz/_assets/v2/search-venue`; class VenueSearch extends React.Component { constructor(props) { super(props); this.state = { location: '', capacity: '', style: '', venue: [], currentPage: 1, venusPerPage: 12 }; this.handleClick = this.handleClick.bind(this); } componentDidMount(){ axios.get(`${url}`) .then(res => { this.setState({ venue: res.data }); }) } handleClick(event) { this.setState({ currentPage: Number(event.target.id) }); } handleChange(stateName, e) { this.setState({ [stateName]: e.target.value }, () =>{ axios.get(`${url}?capacity=${this.state.capacity}&location=${this.state.location}&style=${this.state.style}`) .then(res => { this.setState({ venue: res.data, currentPage: 1 }); }) }); } render() { const { venue, currentPage, venusPerPage } = this.state; const indexOfLastTodo = currentPage * venusPerPage; const indexOfFirstTodo = indexOfLastTodo - venusPerPage; const currentVenues = venue.slice(indexOfFirstTodo, indexOfLastTodo); let renderVenus = null; if(currentVenues.length > 0){ renderVenus = currentVenues.map((data, index) => { return }); } const pageNumbers = []; for (let i = 1; i <= Math.ceil(venue.length / venusPerPage); i++) { pageNumbers.push(i); } const renderPageNumbers = pageNumbers.map(number => { if(number === this.state.currentPage){ return ( {number} ); }else{ return ( {number} ); } }); return (

Venues for your events

Find your venue

Location

Capacity

Style

Having the luxury of over 600 bookable spaces across 3 campuses in Auckland, our team will find you that perfect venue, be it a classroom for a workshop, 400 seater lecture theatre for your plenary session or a bbq and pool booking for that summer outing. Wifi Internet access is available across the whole University and, in most cases, our buildings are equipped with fibre optic networks supplying ultra-fast connectivity. This allows us to supply full live streaming services.

{renderVenus}

{renderPageNumbers}

); } }