Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

mobile style tweaks, rename modal component

Jason Kentd45724e4846e
diff --git a/web/css/event-filter.css b/web/css/event-filter.css
index 19cee807a..d51cc577e 100644
--- a/web/css/event-filter.css
+++ b/web/css/event-filter.css
@@ -100,7 +100,7 @@
padding: 10px 0;
width: 100%;
margin: 0 auto;
-
+ min-height: 35px;
font-size: 15px;
svg {
margin-left: 6px;
diff --git a/web/css/events.css b/web/css/events.css
index 0aa86cca7..5f704dd75 100644
--- a/web/css/events.css
+++ b/web/css/events.css
@@ -19,12 +19,16 @@
}
min-height: 166px;
@media (max-width: 768px) {
- height: calc(100vh - 36px)
+ height: calc(100vh - 36px);
}
.event-scroll-list {
border-top: 1px solid #666;
border-bottom: 1px solid #666;
background: #222;
+ min-height: 260px;
+ @media (max-width: 768px) {
+ min-height: calc(100vh - 140px);
+ }
}
}
@@ -300,6 +304,17 @@
width: 26px;
}
+@media (max-width: 768px) {
+ .event-scroll-list .event-icon {
+ height: 40px;
+ width: 40px;
+ }
+ .wv-map .event-icon {
+ height: 36px;
+ width: 36px;
+ }
+}
+
.event-icon-dust-and-haze {
background: url("../images/natural-events/icon-dust-and-haze.svg");
}
diff --git a/web/css/sidebar.css b/web/css/sidebar.css
index e27ccfb42..751b3612a 100644
--- a/web/css/sidebar.css
+++ b/web/css/sidebar.css
@@ -427,7 +427,7 @@ footer .compare-toggle-button {
width: calc(100vw - 2px);
}
.modal-body {
- height: calc(100vh - 44px)
+ height: calc(100vh - 44px);
}
.modal-footer {
position: absolute;
diff --git a/web/js/components/sidebar/events-filter.js b/web/js/components/sidebar/events-filter.js
index 108943c61..732657c40 100644
--- a/web/js/components/sidebar/events-filter.js
+++ b/web/js/components/sidebar/events-filter.js
@@ -12,7 +12,7 @@ import {
import util from '../../util/util';
import DateRangeSelector from '../date-selector/date-range-selector';
-function EventsFilter (props) {
+function EventFilterModalBody (props) {
const {
eventCategories,
selectedCategories,
@@ -77,56 +77,56 @@ function EventsFilter (props) {
const maxDate = new Date();
return (
- <div className="events-filter">
-
- <DateRangeSelector
- idSuffix="event-filter"
- startDate={startDate}
- endDate={endDate}
- setDateRange={setDateRange}
- minDate={minDate}
- maxDate={maxDate}
- subDailyMode={false}
- />
-
- <div className="category-toggles">
- <div className="classification-switch-header">
- <h2 className="wv-header">Disable/Enable</h2>
- <Switch
- id="header-disable"
- label="All"
- containerClassAddition="header"
- active={allNone}
- toggle={selectAllNone}
- />
-
+ <>
+ <div className="events-filter">
+ <DateRangeSelector
+ idSuffix="event-filter"
+ startDate={startDate}
+ endDate={endDate}
+ setDateRange={setDateRange}
+ minDate={minDate}
+ maxDate={maxDate}
+ subDailyMode={false}
+ />
+
+ <div className="category-toggles">
+ <div className="classification-switch-header">
+ <h2 className="wv-header">Disable/Enable</h2>
+ <Switch
+ id="header-disable"
+ label="All"
+ containerClassAddition="header"
+ active={allNone}
+ toggle={selectAllNone}
+ />
+
+ </div>
+
+ {eventCategories.map((category) => {
+ const { id, title, description } = category;
+ const switchId = `${id}-switch`;
+ const isActive = categories.some((c) => c.title === title);
+ return (
+ <div className="category-switch-row" key={switchId}>
+ <Switch
+ id={switchId}
+ label={title}
+ active={isActive}
+ tooltip={description}
+ toggle={() => toggleCategory(category)}
+ />
+ </div>
+ );
+ })}
</div>
- {eventCategories.map((category) => {
- const { id, title, description } = category;
- const switchId = `${id}-switch`;
- const isActive = categories.some((c) => c.title === title);
- return (
- <div className="category-switch-row" key={switchId}>
- <Switch
- id={switchId}
- label={title}
- active={isActive}
- tooltip={description}
- toggle={() => toggleCategory(category)}
- />
- </div>
- );
- })}
+ <Checkbox
+ id="events-footer-checkbox"
+ label="Only list events in current map view"
+ onCheck={() => setListAll(!listAll)}
+ checked={!listAll}
+ />
</div>
-
- <Checkbox
- id="events-footer-checkbox"
- label="Only list events in current map view"
- onCheck={() => setListAll(!listAll)}
- checked={!listAll}
- />
-
<ModalFooter>
<Button
id="filter-apply-btn"
@@ -141,12 +141,11 @@ function EventsFilter (props) {
Cancel
</Button>
</ModalFooter>
-
- </div>
+ </>
);
}
-EventsFilter.propTypes = {
+EventFilterModalBody.propTypes = {
closeModal: PropTypes.func,
eventCategories: PropTypes.array,
selectedCategories: PropTypes.array,
@@ -183,4 +182,4 @@ const mapDispatchToProps = (dispatch) => ({
},
});
-export default connect(mapStateToProps, mapDispatchToProps)(EventsFilter);
+export default connect(mapStateToProps, mapDispatchToProps)(EventFilterModalBody);
diff --git a/web/js/containers/sidebar/events.js b/web/js/containers/sidebar/events.js
index 173b1b374..f1c199e8c 100644
--- a/web/js/containers/sidebar/events.js
+++ b/web/js/containers/sidebar/events.js
@@ -11,7 +11,7 @@ import {
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import Event from '../../components/sidebar/event';
import EventIcon from '../../components/sidebar/event-icon';
-import EventFilter from '../../components/sidebar/events-filter';
+import EventFilterModalBody from '../../components/sidebar/events-filter';
import Scrollbars from '../../components/util/scrollbar';
import {
selectEvent as selectEventActionCreator,
@@ -195,7 +195,7 @@ const mapDispatchToProps = (dispatch) => ({
dispatch(toggleCustomContent('events-filter', {
headerText: 'Filter Events',
backdrop: false,
- bodyComponent: EventFilter,
+ bodyComponent: EventFilterModalBody,
// Using clickableBehindModal: true here causes an issue where switching sidebar
// tabs does not close this modal
wrapClassName: 'clickable-behind-modal',