A Rails application has been set up with the React On Rails gem for server-rendering React.
This application contains one url - localhost:3000/resorts
which you will have to improve.
A list of regions
along with arrays of their children resorts
are setup in resorts_controller
Using this data, please:
- render
ResortListApp
on the page using React on Rails - Render a dropdown using the three given
regions
as options. The dropdown has the default value of'Colorado'
- bonus points: convert the region dropdown into an autocomplete field where the user can search for a region or a resort
- Render the selected region's resorts as a list. Display their
name
,review_score_avg
andreview_count
values. - Render a map using the Google Map Javascript API available on the page, you can either:
- use a React library such as
https://github.com/tomchentw/react-google-maps
for bonus points, or - use vanilla Javascript and Google Map Javascript API in a
ComponentDidMount
callback
- use a React library such as
- Draw the currently selected region's resorts onto the map as Google Map
Markers
, by using the providedlat
andlng
for each resort - On initial map load, and when the user selects a different region on the dropdown, pan and zoom the map so that it exactly fits all of that region's resort markers inside it
- After clicking on a Marker, render a tooltip containing the resort's information
- Cluster markers together if they overlap
Bonus points:
- setup redux on the page and use redux to populate the data on the page
You have discretion to design the page however you want. For the purposes of the demonstration, you only have to cater for Iphone 7 and Pixel 2 mobile devices, the page does not have to work properly on desktop. Bootstrap is made available on the page if you wish to use any of their utility classes to assist with layout. You can add and use any 3rd party package you like in this project, just include them into package.json
and run yarn
.
# get key
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
# install RVM with Ruby
\curl -sSL https://get.rvm.io | bash -s stable --ruby
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install yarn
# bundler
gem install bundler
# foreman
gem install foreman
# within application folder
bundle install
yarn
# within application folder
touch config/master.key
# write separately provided key into this file
foreman start -f Procfile.dev