Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

mobile style fixes

Jason Kentbf623879a296
diff --git a/web/css/event-filter.css b/web/css/event-filter.css
index d9d3752a3..f7b2475ba 100644
--- a/web/css/event-filter.css
+++ b/web/css/event-filter.css
@@ -56,37 +56,6 @@
}
}
- .react-daterange-picker__inputGroup__input:invalid {
- background: rgba(255, 0, 0, 0.3);
- }
- .react-daterange-picker {
- margin: 4px auto;
- width: 272px;
- text-align: center;
- input,
- .react-daterange-picker__inputGroup__leadingZero,
- .react-daterange-picker__inputGroup__month {
- color: #fff;
- font-family: 'Roboto Mono', monospace;
- font-size: 16px;
- }
- span {
- font-size: 16px;
- }
- .react-daterange-picker__range-divider {
- margin: 0 4px;
- font-size: 12px;
- }
- .react-date-picker__inputGroup__divider {
- margin-right: 2px;
- }
- svg {
- stroke: #fff;
- &:hover {
- stroke: #007bff;
- }
- }
- }
.category-toggles {
margin: 20px 10px 15px;
}
@@ -97,6 +66,7 @@
.event-count {
color: #fff;
+ background: #333;
text-align: center;
padding: 10px 0;
width: 100%;
@@ -106,65 +76,4 @@
svg {
margin-left: 6px;
}
-}
-
-.react-calendar {
- color: #000;
- border-radius: 6px;
- padding: 3px;
- box-shadow: 1px 1px 20px rgba(0, 0, 0, 0.75);
- max-width: unset;
- background: #eee;
- .react-calendar__month-view {
- background: #fefefe;
- border-radius: 6px;
- border: 1px solid #ddd;
- }
- .react-calendar__month-view__days__day--neighboringMonth {
- color: #dfdfdf;
- }
- .react-calendar__month-view__days__day--weekend {
- color: #000;
- &[disabled] {
- color: #ccc !important;
- }
- &.react-calendar__month-view__days__day--neighboringMonth {
- color: #dfdfdf !important;
- }
- }
- .react-calendar__navigation__label__labelText--from {
- margin-right: 100px;
- }
- .react-calendar__navigation__label__labelText--to {
- margin-left: 100px;
- }
- .react-calendar__navigation {
- button {
- min-width: 44px;
- border: 1px solid #ddd;
- border-radius: 6px;
- margin: 2px;
- font-size: 23px;
- background: #fff;
- &:hover {
- background: #e7eeff;
- }
- }
- button.react-calendar__navigation__label {
- background: #fff;
- &:hover {
- background: #e7eeff;
- }
- }
- }
- .react-calendar__year-view__months {
- background: #fff;
- }
- .react-calendar__tile:hover:not([disabled]) {
- background-color: #e7eeff;
- }
- .react-calendar__tile--active:hover:not([disabled]) {
- color: #fff;
- background: #006edc;
- }
-}
+}
\ No newline at end of file
diff --git a/web/css/events.css b/web/css/events.css
index b054f8b47..d31555727 100644
--- a/web/css/events.css
+++ b/web/css/events.css
@@ -18,7 +18,7 @@
}
min-height: 166px;
@media (max-width: 768px) {
- height: calc(var(--vh, 1vh) * 100 - 36px);
+ height: calc(var(--vh, 1vh) * 100 - 75px);
}
.event-scroll-list {
border-top: 1px solid #666;
diff --git a/web/css/sidebar.css b/web/css/sidebar.css
index 1a42a07cd..7ef81af5a 100644
--- a/web/css/sidebar.css
+++ b/web/css/sidebar.css
@@ -142,21 +142,20 @@
}
#productsHolder footer {
- padding: 5px;
width: initial;
}
footer .product-buttons {
- padding: 5px;
- height: 37px;
+ padding: 10px;
+ height: 47px;
width: initial;
}
footer .layers-add {
position: absolute;
- left: 5px;
+ left: 10px;
}
footer .compare-toggle-button {
position: absolute;
- right: 5px;
+ right: 10px;
border-bottom: none;
}
@@ -285,7 +284,7 @@ footer .compare-toggle-button {
}
#productsHolder footer .product-buttons {
- height: 110px;
+ height: 120px;
}
}
diff --git a/web/js/containers/sidebar/events.js b/web/js/containers/sidebar/events.js
index fb3bfb219..5dab7da86 100644
--- a/web/js/containers/sidebar/events.js
+++ b/web/js/containers/sidebar/events.js
@@ -4,7 +4,6 @@ import { connect } from 'react-redux';
import moment from 'moment';
import {
Button,
- UncontrolledTooltip,
} from 'reactstrap';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
@@ -21,7 +20,6 @@ import { selectDate } from '../../modules/date/actions';
import { getSelectedDate } from '../../modules/date/selectors';
import { toggleCustomContent } from '../../modules/modal/actions';
import util from '../../util/util';
-import { LIMIT_EVENT_REQUEST_COUNT } from '../../modules/natural-events/constants';
function Events(props) {
const {
@@ -44,8 +42,8 @@ function Events(props) {
selectedCategories,
} = props;
- const dropdownHeight = 34;
- const maxHeight = Math.max(height - dropdownHeight, 166);
+ const filterControlHeight = 72;
+ const maxHeight = Math.max(height - filterControlHeight, 166);
const scrollbarMaxHeight = isEmbedModeActive ? '50vh' : `${maxHeight}px`;
const startDate = moment(selectedStartDate).format('YYYY MMM DD');
@@ -57,8 +55,6 @@ function Events(props) {
? 'There has been an ERROR retrieving events from the EONET events API. Please try again later.'
: '';
- const eventLimitReach = eventsData && eventsData.length === LIMIT_EVENT_REQUEST_COUNT;
- const numEvents = eventsData ? eventsData.length : 0;
const renderFilterControls = () => (
<div className="filter-controls">
@@ -129,38 +125,10 @@ function Events(props) {
</Scrollbars>
);
- const renderEventCount = () => (
- <div className="event-count">
- {eventsData && eventLimitReach ? (
- <>
- <span>
- {`Showing the first ${numEvents} events`}
- </span>
- <FontAwesomeIcon id="filter-info-icon" icon="info-circle" />
- <UncontrolledTooltip
- placement="right"
- target="filter-info-icon"
- >
- <div>
- More than
- {` ${LIMIT_EVENT_REQUEST_COUNT} `}
- events matched the current filter criteria.
- </div>
- </UncontrolledTooltip>
- </>
- ) : (
- <span>
- {`Showing ${numEvents} events`}
- </span>
- )}
- </div>
- );
-
return (
<div className="event-container">
{renderFilterControls()}
{renderEventList()}
- {renderEventCount()}
</div>
);
}
diff --git a/web/js/containers/sidebar/footer-content.js b/web/js/containers/sidebar/footer-content.js
index a38e46f13..e37a5311a 100644
--- a/web/js/containers/sidebar/footer-content.js
+++ b/web/js/containers/sidebar/footer-content.js
@@ -2,12 +2,18 @@ import React from 'react';
import PropTypes from 'prop-types';
import googleTagManager from 'googleTagManager';
import { connect } from 'react-redux';
+import {
+ UncontrolledTooltip,
+} from 'reactstrap';
+import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import Button from '../../components/util/button';
import ModeSelection from '../../components/sidebar/mode-selection';
import { toggleCompareOnOff, changeMode } from '../../modules/compare/actions';
import SearchUiProvider from '../../components/layer/product-picker/search-ui-provider';
import { openCustomContent } from '../../modules/modal/actions';
import { stop as stopAnimationAction } from '../../modules/animation/actions';
+import { getEventsFilteredCategories } from '../../modules/natural-events/selectors';
+import { LIMIT_EVENT_REQUEST_COUNT } from '../../modules/natural-events/constants';
const FooterContent = React.forwardRef((props, ref) => {
const {
@@ -20,6 +26,7 @@ const FooterContent = React.forwardRef((props, ref) => {
addLayers,
toggleCompare,
compareFeature,
+ eventsData,
} = props;
const compareBtnText = !isCompareActive
? `Start Comparison${isMobile ? ' Mode' : ''}`
@@ -37,8 +44,8 @@ const FooterContent = React.forwardRef((props, ref) => {
googleTagManager.pushEvent({ event: 'comparison_mode' });
};
- return activeTab === 'layers' ? (
- <footer ref={ref}>
+ const renderLayersFooter = () => (
+ <>
<ModeSelection
isActive={isCompareActive}
isMobile={isMobile}
@@ -62,8 +69,47 @@ const FooterContent = React.forwardRef((props, ref) => {
text={compareBtnText}
/>
</div>
+ </>
+ );
+
+ const renderEventsFooter = () => {
+ const eventLimitReach = eventsData && eventsData.length === LIMIT_EVENT_REQUEST_COUNT;
+ const numEvents = eventsData ? eventsData.length : 0;
+ return (
+ <div className="event-count">
+ {eventsData && eventLimitReach ? (
+ <>
+ <span>
+ {`Showing the first ${numEvents} events`}
+ </span>
+ <FontAwesomeIcon id="filter-info-icon" icon="info-circle" />
+ <UncontrolledTooltip
+ placement="right"
+ target="filter-info-icon"
+ >
+ <div>
+ More than
+ {` ${LIMIT_EVENT_REQUEST_COUNT} `}
+ events matched the current filter criteria.
+ </div>
+ </UncontrolledTooltip>
+ </>
+ ) : (
+ <span>
+ {`Showing ${numEvents} events`}
+ </span>
+ )}
+ </div>
+ );
+ };
+
+
+ return (
+ <footer ref={ref}>
+ {activeTab === 'layers' && renderLayersFooter()}
+ {activeTab === 'events' && renderEventsFooter()}
</footer>
- ) : null;
+ );
});
const mapDispatchToProps = (dispatch) => ({
@@ -94,6 +140,7 @@ const mapStateToProps = (state) => {
animation, config, compare, browser,
} = state;
const { isPlaying } = animation;
+ const eventsData = getEventsFilteredCategories(state);
return {
isMobile: browser.lessThan.medium,
@@ -101,6 +148,7 @@ const mapStateToProps = (state) => {
compareFeature: config.features.compare,
isCompareActive: compare.active,
compareMode: compare.mode,
+ eventsData,
};
};
@@ -117,6 +165,7 @@ FooterContent.propTypes = {
changeCompareMode: PropTypes.func,
compareFeature: PropTypes.bool,
compareMode: PropTypes.string,
+ eventsData: PropTypes.array,
isCompareActive: PropTypes.bool,
isMobile: PropTypes.bool,
isPlaying: PropTypes.bool,