diff --git a/package-lock.json b/package-lock.json index cca1a43..2f410dc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "0.1.0", "dependencies": { "date-fns": "^2.29.3", + "lodash": "^4.17.21", "mapbox-gl": "^2.7.1", "react": "^17.0.2", "react-datepicker": "^4.10.0", @@ -9356,7 +9357,8 @@ }, "node_modules/lodash": { "version": "4.17.21", - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, "node_modules/lodash.debounce": { "version": "4.0.8", diff --git a/package.json b/package.json index 02c903a..00aaec5 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "private": false, "dependencies": { "date-fns": "^2.29.3", + "lodash": "^4.17.21", "mapbox-gl": "^2.7.1", "react": "^17.0.2", "react-datepicker": "^4.10.0", diff --git a/src/App.css b/src/App.css index 297e9ab..3656ba6 100644 --- a/src/App.css +++ b/src/App.css @@ -10,30 +10,18 @@ header { margin-right: 1rem; } -.Header-Text { - display: flex; - align-items: baseline; -} - .Header-Title { margin: 0; - margin-right: 1rem; font-size: 2rem; } -.Header-Explainer { - margin: 0; - font-size: 0.75rem; - font-style: italic; -} - .Content { display: flex; } .Content-FilterPane { flex-basis: 30%; - min-width: 250px; + min-width: 300px; padding-left: 1.5rem; padding-right: 1rem; padding-bottom: 1.5rem; @@ -48,38 +36,62 @@ header { font-size: 0.75rem; } -.Filters-Header { - display: flex; - justify-content: space-between; - margin-top: 1rem; - margin-bottom: 1rem; -} - -.Filters-Header-Label { +.Filters-Reset { margin: 0; } -.Filters-Header-Reset { - margin-top: auto; - margin-bottom: auto; -} - form > label { font-size: 1rem; display: block; margin-bottom: 0.25rem; } -.Filter-Label-Text { - width: 80px; +.Filter-Text { + font-size: 1.25rem; + line-height: 1.65rem; + margin: 1.5rem 0; +} + +.Filter-DateText { + width: 100px; + font-size: 1rem; + display: inline !important; +} + +.Filter-SelectText { + font-size: 1rem; + margin: 0 0.4rem; +} + +.Filter-List { + padding: 0; + margin: 0; + list-style: none; + margin-top: 0.25rem; + padding-left: 1.5rem; +} + +.Filter-ListItem { + display: flex; + align-items: center; } .react-datepicker-wrapper { - display: inline; + display: inline !important; } .react-datepicker__input-container { - display: inline; + display: inline !important; +} + +/* Prevent the date picker from pushing the following text to a new line */ +.react-datepicker__tab-loop { + position: absolute; +} + +.Filter-Checkbox { + transform: scale(1.15); + margin-right: 0.55rem; } .Map-Popup { diff --git a/src/App.js b/src/App.js index 87b8c4d..10529d4 100644 --- a/src/App.js +++ b/src/App.js @@ -1,4 +1,5 @@ import { add, sub } from "date-fns"; +import { range } from "lodash"; import React, { Component, Fragment } from "react"; import ReactMapGL, { Marker, Popup } from "react-map-gl"; import DatePicker from "react-datepicker"; @@ -12,9 +13,9 @@ const Filters = ({ onChangeAfterDate, beforeDate, onChangeBeforeDate, - consecutiveDaysMax, - consecutiveDays, - onChangeConsecutiveDays, + consecutiveNightsMax, + consecutiveNights, + onChangeConsecutiveNights, allCellCarriers, cellCarrier, onChangeCellCarrier, @@ -36,91 +37,116 @@ const Filters = ({ return (
-
-

Filters

- -
-
e.preventDefault()}> -
); @@ -175,7 +201,10 @@ const MapPopup = ({ location, info, onClose }) => { ) : ( - Available for {availableDates.length} total days: + + Available for {availableDates.length} nights over the next 6 + months: +