By Brian Sunday
This is a beach resort created in react that displays all the rooms in this make belief resort.Users can view rooms available and filter by various criterias.
$ git clone
react-resort$ cd react-resort
$ npm install
to install all dependencies$ npm start
to launch the application- open
localhost:3000
to view the app - navigate to roomContext and paste for the following to be able to use the local data.js file
getData = () => {
let rooms = this.formatData(items);
let featuredRooms = rooms.filter((room) => room.featured === true);
let maxPrice = Math.max(...rooms.map((room) => room.price));
let maxSize = Math.max(...rooms.map((room) => room.size));
this.setState({
rooms,
featuredRooms,
maxPrice,
price: maxPrice,
maxSize,
sortedRooms: rooms,
loading: false,
});
};
componentDidMount() {
// fetch date
this.getData();
}
- No known Bugs
- React
- Netlify
- Contentful
- Styled components
You can learn more in the Create React App documentation.
To learn React, check out the React documentation.
MIT (c) 2019 Brian Sunday