Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

WV-2177: Replacing the Redux-Responsive library for better mobile detection (#3967)

Ryan Weilerd633a0156334
diff --git a/e2e/features/layers/layer-picker-mobile-test.js b/e2e/features/layers/layer-picker-mobile-test.js
index a0acb314e..80172df68 100644
--- a/e2e/features/layers/layer-picker-mobile-test.js
+++ b/e2e/features/layers/layer-picker-mobile-test.js
@@ -79,6 +79,8 @@ module.exports = {
},
'Available grid source layer measuremet does not have unavaiable coverage class': (c) => {
// swith to Aqua/MODIS measurement nav item
+ c.click(aquaTerraMODISTab);
+ c.pause(500);
c.click(aquaModisTab);
c.waitForElementVisible(aodTabContentAquaMODIS, TIME_LIMIT, (e) => {
c.expect.element(aodCheckbox).to.be.present;
diff --git a/e2e/features/measure/measure-test.js b/e2e/features/measure/measure-test.js
index 020bac629..229c84bba 100644
--- a/e2e/features/measure/measure-test.js
+++ b/e2e/features/measure/measure-test.js
@@ -85,16 +85,16 @@ module.exports = {
c.useCss().click(measureBtn);
c.waitForElementVisible(measureMenu, TIME_LIMIT, (el) => {
c.useCss().click(measureAreaBtn);
- c.moveTo(null, -250, 10);
+ c.moveTo(null, -200, -30);
c.mouseButtonClick(0);
- c.pause(200);
- c.moveTo(null, 0, 100);
+ c.pause(300);
+ c.moveTo(null, 0, -40);
c.mouseButtonClick(0);
- c.pause(200);
- c.moveTo(null, 100, 0);
+ c.pause(300);
+ c.moveTo(null, 200, 0);
c.mouseButtonClick(0);
- c.pause(200);
- c.moveTo(null, 0, -100);
+ c.pause(300);
+ c.moveTo(null, 0, -50);
c.mouseButtonClick(0);
c.mouseButtonClick(0);
c.waitForElementVisible(geoMeasurementTooltip, TIME_LIMIT);
diff --git a/package-lock.json b/package-lock.json
index 7d54768c2..404b838a2 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -47,6 +47,7 @@
"react-autocomplete": "^1.8.1",
"react-beautiful-dnd": "^13.0.0",
"react-contextmenu": "^2.14.0",
+ "react-device-detect": "^2.2.2",
"react-dom": "^16.12.0",
"react-draggable": "^4.1.0",
"react-image-crop": "^9.1.1",
@@ -63,7 +64,6 @@
"redux": "^4.0.4",
"redux-location-state": "^2.6.0",
"redux-logger": "^3.0.6",
- "redux-responsive": "^4.3.8",
"redux-thunk": "^2.3.0",
"regenerator-runtime": "^0.13.3",
"reselect": "^4.0.0",
@@ -14019,10 +14019,6 @@
"node": ">= 0.6"
}
},
- "node_modules/mediaquery": {
- "version": "0.0.3",
- "license": "MIT"
- },
"node_modules/memoize-one": {
"version": "5.2.1",
"license": "MIT"
@@ -20116,6 +20112,18 @@
"react-dom": "^0.14.0 || ^15.0.0 || ^16.0.1"
}
},
+ "node_modules/react-device-detect": {
+ "version": "2.2.2",
+ "resolved": "https://registry.npmjs.org/react-device-detect/-/react-device-detect-2.2.2.tgz",
+ "integrity": "sha512-zSN1gIAztUekp5qUT/ybHwQ9fmOqVT1psxpSlTn1pe0CO+fnJHKRLOWWac5nKxOxvOpD/w84hk1I+EydrJp7SA==",
+ "dependencies": {
+ "ua-parser-js": "^1.0.2"
+ },
+ "peerDependencies": {
+ "react": ">= 0.14.0",
+ "react-dom": ">= 0.14.0"
+ }
+ },
"node_modules/react-dom": {
"version": "16.14.0",
"license": "MIT",
@@ -20700,16 +20708,6 @@
"lodash.isplainobject": "^4.0.6"
}
},
- "node_modules/redux-responsive": {
- "version": "4.3.8",
- "license": "MIT",
- "dependencies": {
- "mediaquery": "0.0.3"
- },
- "peerDependencies": {
- "redux": "^4.0.0"
- }
- },
"node_modules/redux-thunk": {
"version": "2.4.1",
"license": "MIT",
@@ -24496,6 +24494,24 @@
"node": ">=4.2.0"
}
},
+ "node_modules/ua-parser-js": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.2.tgz",
+ "integrity": "sha512-00y/AXhx0/SsnI51fTc0rLRmafiGOM4/O+ny10Ps7f+j/b8p/ZY11ytMgznXkOVo4GQ+KwQG5UQLkLGirsACRg==",
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/ua-parser-js"
+ },
+ {
+ "type": "paypal",
+ "url": "https://paypal.me/faisalman"
+ }
+ ],
+ "engines": {
+ "node": "*"
+ }
+ },
"node_modules/unbox-primitive": {
"version": "1.0.2",
"dev": true,
@@ -36518,9 +36534,6 @@
"version": "0.3.0",
"dev": true
},
- "mediaquery": {
- "version": "0.0.3"
- },
"memoize-one": {
"version": "5.2.1"
},
@@ -40529,6 +40542,14 @@
"object-assign": "^4.1.0"
}
},
+ "react-device-detect": {
+ "version": "2.2.2",
+ "resolved": "https://registry.npmjs.org/react-device-detect/-/react-device-detect-2.2.2.tgz",
+ "integrity": "sha512-zSN1gIAztUekp5qUT/ybHwQ9fmOqVT1psxpSlTn1pe0CO+fnJHKRLOWWac5nKxOxvOpD/w84hk1I+EydrJp7SA==",
+ "requires": {
+ "ua-parser-js": "^1.0.2"
+ }
+ },
"react-dom": {
"version": "16.14.0",
"requires": {
@@ -40928,12 +40949,6 @@
"lodash.isplainobject": "^4.0.6"
}
},
- "redux-responsive": {
- "version": "4.3.8",
- "requires": {
- "mediaquery": "0.0.3"
- }
- },
"redux-thunk": {
"version": "2.4.1",
"requires": {}
@@ -43520,6 +43535,11 @@
"dev": true,
"peer": true
},
+ "ua-parser-js": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.2.tgz",
+ "integrity": "sha512-00y/AXhx0/SsnI51fTc0rLRmafiGOM4/O+ny10Ps7f+j/b8p/ZY11ytMgznXkOVo4GQ+KwQG5UQLkLGirsACRg=="
+ },
"unbox-primitive": {
"version": "1.0.2",
"dev": true,
diff --git a/package.json b/package.json
index 7338b5535..16a7684c7 100644
--- a/package.json
+++ b/package.json
@@ -201,6 +201,7 @@
"react-autocomplete": "^1.8.1",
"react-beautiful-dnd": "^13.0.0",
"react-contextmenu": "^2.14.0",
+ "react-device-detect": "^2.2.2",
"react-dom": "^16.12.0",
"react-draggable": "^4.1.0",
"react-image-crop": "^9.1.1",
@@ -217,7 +218,6 @@
"redux": "^4.0.4",
"redux-location-state": "^2.6.0",
"redux-logger": "^3.0.6",
- "redux-responsive": "^4.3.8",
"redux-thunk": "^2.3.0",
"regenerator-runtime": "^0.13.3",
"reselect": "^4.0.0",
diff --git a/web/js/app.js b/web/js/app.js
index 6c278b4cb..f7a054629 100644
--- a/web/js/app.js
+++ b/web/js/app.js
@@ -5,7 +5,6 @@ import PropTypes from 'prop-types';
import whatInput from 'what-input';
// Utils
-import { calculateResponsiveState } from 'redux-responsive';
import util from './util/util';
import { STARTUP } from './util/constants';
// eslint-disable-next-line import/no-named-as-default
@@ -34,6 +33,7 @@ import AnimationWidget from './containers/animation-widget';
import ErrorBoundary from './containers/error-boundary';
import Debug from './components/util/debug';
import keyPress from './modules/key-press/actions';
+import setScreenInfo from './modules/screen-size/actions';
// Dependency CSS
import '../../node_modules/bootstrap/dist/css/bootstrap.min.css';
@@ -83,6 +83,11 @@ class App extends React.Component {
keyPressAction(event.keyCode, event.shiftKey, ctrlOrCmdKey, isInput);
}
+ getScreenInfo = () => {
+ const { setScreenInfoAction } = this.props;
+ setScreenInfoAction();
+ }
+
onload() {
const self = this;
const state = self.props.parameters;
@@ -114,9 +119,12 @@ class App extends React.Component {
console.warn('Development version');
}
window.addEventListener('resize', () => {
- self.props.screenResize(window);
+ self.getScreenInfo();
+ });
+ window.addEventListener('orientationchange', () => {
+ self.getScreenInfo();
});
- self.props.screenResize(window);
+ self.getScreenInfo();
events.trigger(STARTUP);
self.setVhCSSProperty();
};
@@ -170,7 +178,7 @@ function mapStateToProps(state) {
state,
isAnimationWidgetActive: state.animation.isActive,
isEmbedModeActive: state.embed.isEmbedModeActive,
- isMobile: state.browser.lessThan.medium,
+ isMobile: state.screenSize.isMobileDevice,
isTourActive: state.tour.active,
tour: state.tour,
config: state.config,
@@ -183,8 +191,8 @@ const mapDispatchToProps = (dispatch) => ({
keyPressAction: (keyCode, shiftKey, ctrlOrCmdKey, isInput) => {
dispatch(keyPress(keyCode, shiftKey, ctrlOrCmdKey, isInput));
},
- screenResize: (width, height) => {
- dispatch(calculateResponsiveState(window));
+ setScreenInfoAction: () => {
+ dispatch(setScreenInfo());
},
});
@@ -199,6 +207,7 @@ App.propTypes = {
isMobile: PropTypes.bool,
isTourActive: PropTypes.bool,
keyPressAction: PropTypes.func,
+ setScreenInfoAction: PropTypes.func,
locationKey: PropTypes.string,
modalId: PropTypes.string,
parameters: PropTypes.object,
diff --git a/web/js/components/context-menu/context-menu.js b/web/js/components/context-menu/context-menu.js
index f11fd5302..9b1caba1d 100644
--- a/web/js/components/context-menu/context-menu.js
+++ b/web/js/components/context-menu/context-menu.js
@@ -22,7 +22,7 @@ function RightClickMenu(props) {
const [toolTipToggleTime, setToolTipToggleTime] = useState(0);
const [formattedCoordinates, setFormattedCoordinates] = useState();
const {
- map, proj, unitOfMeasure, onToggleUnits, isCoordinateSearchActive, allMeasurements, measurementIsActive,
+ map, proj, unitOfMeasure, onToggleUnits, isCoordinateSearchActive, allMeasurements, measurementIsActive, isMobile,
} = props;
const { crs } = proj.selected;
const measurementsInProj = !!Object.keys(allMeasurements[crs]).length;
@@ -86,6 +86,8 @@ function RightClickMenu(props) {
};
});
+ const mobileStyle = isMobile && 'react-contextmenu-mobile';
+
return show && (
<div id="context-menu">
<CopyClipboardTooltip
@@ -97,6 +99,7 @@ function RightClickMenu(props) {
<MenuItem
onClick={() => copyCoordsToClipboard()}
attributes={{ id: 'context-menu-copy' }}
+ className={mobileStyle}
>
<span id="copy-coordinates-to-clipboard-button">
{formattedCoordinates}
@@ -105,6 +108,7 @@ function RightClickMenu(props) {
<MenuItem
onClick={() => addPlaceMarkerHandler(pixelCoords, map, crs)}
attributes={{ id: 'context-menu-add-marker' }}
+ className={mobileStyle}
>
Add Place Marker
</MenuItem>
@@ -112,12 +116,14 @@ function RightClickMenu(props) {
<MenuItem
onClick={() => handleMeasurementMenu('distance')}
attributes={{ id: 'context-menu-measure-distance' }}
+ className={mobileStyle}
>
Measure Distance
</MenuItem>
<MenuItem
onClick={() => handleMeasurementMenu('area')}
attributes={{ id: 'context-menu-measure-area' }}
+ className={mobileStyle}
>
Measure Area
</MenuItem>
@@ -126,6 +132,7 @@ function RightClickMenu(props) {
<MenuItem
onClick={() => handleMeasurementMenu('clear')}
attributes={{ id: 'context-menu-clear-measurements' }}
+ className={mobileStyle}
>
Remove Measurements
</MenuItem>
@@ -133,6 +140,7 @@ function RightClickMenu(props) {
<MenuItem
onClick={() => handleMeasurementMenu('units')}
attributes={{ id: 'context-menu-change-units' }}
+ className={mobileStyle}
>
Change Units to
{' '}
@@ -145,7 +153,7 @@ function RightClickMenu(props) {
function mapStateToProps(state) {
const {
- map, proj, measure, locationSearch, config,
+ map, proj, measure, locationSearch, config, screenSize,
} = state;
const { unitOfMeasure, allMeasurements, isActive } = measure;
const { coordinates, isCoordinateSearchActive } = locationSearch;
@@ -158,6 +166,7 @@ function mapStateToProps(state) {
coordinates,
isCoordinateSearchActive,
config,
+ isMobile: screenSize.isMobileDevice,
};
}
@@ -174,6 +183,7 @@ RightClickMenu.propTypes = {
isCoordinateSearchActive: PropTypes.bool,
allMeasurements: PropTypes.object,
measurementIsActive: PropTypes.bool,
+ isMobile: PropTypes.bool,
};
export default connect(
diff --git a/web/js/components/layer/product-picker/browse/browse-layers.js b/web/js/components/layer/product-picker/browse/browse-layers.js
index b2089ce37..8c7a56ae9 100644
--- a/web/js/components/layer/product-picker/browse/browse-layers.js
+++ b/web/js/components/layer/product-picker/browse/browse-layers.js
@@ -31,7 +31,7 @@ import safeLocalStorage from '../../../../util/local-storage';
function BrowseLayers (props) {
const {
- browser,
+ isMobile,
categoryTabNames,
categoryType,
mode,
@@ -94,7 +94,7 @@ function BrowseLayers (props) {
<BrowseLayerList />
</div>
</div>
- { !browser.lessThan.medium && (
+ { !isMobile && (
<div className="layer-detail-container layers-all browse">
<MeasurementMetadataDetail />
</div>
@@ -201,7 +201,7 @@ function BrowseLayers (props) {
return (
<>
- { browser.lessThan.medium ? renderMobileDropdown() : renderDesktopTabs() }
+ { isMobile ? renderMobileDropdown() : renderDesktopTabs() }
{
isCategoryDisplay
? (
@@ -215,10 +215,10 @@ function BrowseLayers (props) {
}
BrowseLayers.propTypes = {
- browser: PropTypes.object,
categoryTabNames: PropTypes.array,
categoryType: PropTypes.string,
clearRecentLayers: PropTypes.func,
+ isMobile: PropTypes.bool,
selectedCategoryName: PropTypes.string,
mode: PropTypes.string,
recentLayers: PropTypes.array,
@@ -251,10 +251,10 @@ const mapDispatchToProps = (dispatch) => ({
function mapStateToProps(state) {
const {
config,
- browser,
proj,
productPicker,
layers,
+ screenSize,
} = state;
const {
mode,
@@ -266,7 +266,7 @@ function mapStateToProps(state) {
recentLayers,
} = productPicker;
return {
- browser,
+ isMobile: screenSize.isMobileDevice,
mode,
selectedCategoryName: category && category.title,
categoryType,
diff --git a/web/js/components/layer/product-picker/browse/category-layer-row.js b/web/js/components/layer/product-picker/browse/category-layer-row.js
index a76c17115..0d4a19733 100644
--- a/web/js/components/layer/product-picker/browse/category-layer-row.js
+++ b/web/js/components/layer/product-picker/browse/category-layer-row.js
@@ -244,11 +244,11 @@ CategoryLayerRow.propTypes = {
const mapStateToProps = (state) => {
const {
config,
- browser,
proj,
productPicker,
+ screenSize,
} = state;
- const isMobile = browser.lessThan.medium;
+ const isMobile = screenSize.isMobileDevice;
const {
selectedMeasurement,
selectedMeasurementSourceIndex,
diff --git a/web/js/components/layer/product-picker/browse/measurement-layer-row.js b/web/js/components/layer/product-picker/browse/measurement-layer-row.js
index 18ba2e16c..8e55b29bb 100644
--- a/web/js/components/layer/product-picker/browse/measurement-layer-row.js
+++ b/web/js/components/layer/product-picker/browse/measurement-layer-row.js
@@ -101,12 +101,12 @@ MeasurementLayerRow.propTypes = {
};
const mapStateToProps = (state, ownProps) => {
- const { notifications, browser } = state;
+ const { notifications, screenSize } = state;
const activeLayerMap = getActiveLayersMap(state);
const { id } = ownProps.layer;
return {
isEnabled: !!activeLayerMap[id],
- isMobile: browser.lessThan.medium,
+ isMobile: screenSize.isMobile,
selectedDate: getSelectedDate(state),
layerNotices: getLayerNoticesForLayer(id, notifications),
};
diff --git a/web/js/components/layer/product-picker/browse/recent-layers.js b/web/js/components/layer/product-picker/browse/recent-layers.js
index 6ea6f3a57..f0c220da6 100644
--- a/web/js/components/layer/product-picker/browse/recent-layers.js
+++ b/web/js/components/layer/product-picker/browse/recent-layers.js
@@ -75,7 +75,7 @@ RecentLayersList.propTypes = {
};
const mapStateToProps = (state) => {
- const { browser, productPicker } = state;
+ const { screenSize, productPicker } = state;
const {
selectedLayer,
showMobileFacets,
@@ -83,9 +83,9 @@ const mapStateToProps = (state) => {
} = productPicker;
return {
- browser,
- smallView: browser.screenWidth < 1024,
- isMobile: browser.lessThan.medium,
+ screenSize,
+ smallView: window.innerWidth < 1024,
+ isMobile: screenSize.isMobileDevice,
showMobileFacets,
selectedLayer,
recentLayers,
diff --git a/web/js/components/layer/product-picker/header.js b/web/js/components/layer/product-picker/header.js
index 8e7d9c520..c429202e1 100644
--- a/web/js/components/layer/product-picker/header.js
+++ b/web/js/components/layer/product-picker/header.js
@@ -266,7 +266,7 @@ const mapDispatchToProps = (dispatch) => ({
});
const mapStateToProps = (state) => {
- const { productPicker, browser, proj } = state;
+ const { productPicker, screenSize, proj } = state;
const {
mode,
category,
@@ -275,7 +275,7 @@ const mapStateToProps = (state) => {
selectedLayer,
searchConfig,
} = productPicker;
- const isMobile = browser.lessThan.medium;
+ const isMobile = screenSize.isMobileDevice;
const layers = getLayersForProjection(state);
return {
diff --git a/web/js/components/layer/product-picker/product-picker.js b/web/js/components/layer/product-picker/product-picker.js
index f832a0af3..31af16d13 100644
--- a/web/js/components/layer/product-picker/product-picker.js
+++ b/web/js/components/layer/product-picker/product-picker.js
@@ -123,15 +123,15 @@ const mapDispatchToProps = (dispatch) => ({
const mapStateToProps = (state) => {
const {
- browser,
+ screenSize,
productPicker,
} = state;
- const { screenWidth } = browser;
+ const { screenWidth } = screenSize;
const width = getModalWidth(screenWidth);
const { mode, category, categoryType } = productPicker;
return {
- browser,
+ screenSize,
category,
categoryType,
mode,
diff --git a/web/js/components/layer/product-picker/search/facets.js b/web/js/components/layer/product-picker/search/facets.js
index 40f972e24..b446a9e92 100644
--- a/web/js/components/layer/product-picker/search/facets.js
+++ b/web/js/components/layer/product-picker/search/facets.js
@@ -15,7 +15,8 @@ import { getSelectedDate } from '../../../../modules/date/selectors';
function Facets(props) {
const {
isMobile,
- browser,
+ screenWidth,
+ breakpoints,
facets,
filters,
removeFilter,
@@ -26,10 +27,12 @@ function Facets(props) {
toggleCollapseFacet,
} = props;
- const showFacets = (browser.greaterThan.small && results.length) || showMobileFacets;
+ const showFacets = (!isMobile && results.length) || showMobileFacets;
+
+ const classNames = isMobile || screenWidth < breakpoints.small ? 'facet-container-mobile facet-container' : 'facet-container';
return !showFacets ? null : (
- <div className="facet-container">
+ <div className={classNames}>
<FilterChips
filters={filters}
@@ -67,11 +70,12 @@ function Facets(props) {
}
Facets.propTypes = {
- browser: PropTypes.object,
collapsedFacets: PropTypes.object,
facets: PropTypes.object,
filters: PropTypes.array,
isMobile: PropTypes.bool,
+ breakpoints: PropTypes.object,
+ screenWidth: PropTypes.number,
removeFilter: PropTypes.func,
results: PropTypes.array,
showMobileFacets: PropTypes.bool,
@@ -89,15 +93,17 @@ const mapDispatchToProps = (dispatch) => ({
});
function mapStateToProps(state) {
- const { browser, productPicker } = state;
+ const { screenSize, productPicker } = state;
const { showMobileFacets, collapsedFacets } = productPicker;
return {
collapsedFacets,
selectedDate: getSelectedDate(state),
- isMobile: browser.lessThan.medium,
+ isMobile: screenSize.isMobileDevice,
+ screenWidth: screenSize.screenWidth,
+ breakpoints: screenSize.breakpoints,
showMobileFacets,
- browser,
+ screenSize,
};
}
export default withSearch(
diff --git a/web/js/components/layer/product-picker/search/search-layer-row.js b/web/js/components/layer/product-picker/search/search-layer-row.js
index f1981341c..b0565b424 100644
--- a/web/js/components/layer/product-picker/search/search-layer-row.js
+++ b/web/js/components/layer/product-picker/search/search-layer-row.js
@@ -189,13 +189,13 @@ SearchLayerRow.propTypes = {
};
const mapStateToProps = (state, ownProps) => {
- const { productPicker, browser, notifications } = state;
+ const { productPicker, notifications, screenSize } = state;
const activeLayerMap = getActiveLayersMap(state);
const { categoryType, selectedLayer } = productPicker;
return {
- scrollIntoView: browser.screenWidth < 1024,
+ scrollIntoView: screenSize.screenWidth < 1024,
isEnabled: !!activeLayerMap[ownProps.layer.id],
- isMobile: browser.lessThan.medium,
+ isMobile: screenSize.isMobileDevice,
layerNotices: getLayerNoticesForLayer(ownProps.layer.id, notifications),
selectedDate: getSelectedDate(state),
selectedLayer,
diff --git a/web/js/components/layer/product-picker/search/search-layers-list.js b/web/js/components/layer/product-picker/search/search-layers-list.js
index efc7f986c..0fb0592f9 100644
--- a/web/js/components/layer/product-picker/search/search-layers-list.js
+++ b/web/js/components/layer/product-picker/search/search-layers-list.js
@@ -190,10 +190,10 @@ SearchLayerList.propTypes = {
};
const mapStateToProps = (state) => {
- const { productPicker, browser } = state;
+ const { productPicker, screenSize } = state;
const { selectedLayer, categoryType } = productPicker;
return {
- isMobile: browser.lessThan.medium,
+ isMobile: screenSize.isMobileDevice,
recentLayerMode: categoryType === 'recent',
selectedLayer,
};
diff --git a/web/js/components/layer/product-picker/search/search-layers.js b/web/js/components/layer/product-picker/search/search-layers.js
index f55dd161d..c27f2be58 100644
--- a/web/js/components/layer/product-picker/search/search-layers.js
+++ b/web/js/components/layer/product-picker/search/search-layers.js
@@ -10,13 +10,14 @@ function SearchLayers(props) {
const {
smallView,
isMobile,
- browser,
+ width,
+ mediumBreakpoint,
selectedLayer,
showMobileFacets,
results,
} = props;
- const showFacets = browser.greaterThan.small || showMobileFacets;
+ const showFacets = (width > mediumBreakpoint && !isMobile) || showMobileFacets;
const showListAndDetails = isMobile ? !showFacets : true;
return (
@@ -27,7 +28,7 @@ function SearchLayers(props) {
<div className="layer-list-container search">
<SearchLayerList />
</div>
- { !selectedLayer && smallView ? null : !!results.length && (
+ {!selectedLayer && smallView ? null : !!results.length && (
<div className="layer-detail-container layers-all search">
<LayerMetadataDetail layer={selectedLayer} />
</div>
@@ -39,8 +40,9 @@ function SearchLayers(props) {
}
SearchLayers.propTypes = {
- browser: PropTypes.object,
+ width: PropTypes.number,
isMobile: PropTypes.bool,
+ mediumBreakpoint: PropTypes.number,
results: PropTypes.array,
selectedLayer: PropTypes.object,
smallView: PropTypes.bool,
@@ -48,16 +50,18 @@ SearchLayers.propTypes = {
};
function mapStateToProps(state) {
- const { browser, productPicker } = state;
+ const { screenSize, productPicker } = state;
const { selectedLayer, showMobileFacets } = productPicker;
return {
layer: selectedLayer,
- smallView: browser.screenWidth < 1024,
- isMobile: browser.lessThan.medium,
+ smallView: screenSize.screenWidth < screenSize.breakpoints.small,
+ isMobile: screenSize.isMobileDevice,
+ width: screenSize.screenWidth,
+ mediumBreakpoint: screenSize.breakpoints.medium,
showMobileFacets,
selectedLayer,
- browser,
+ screenSize,
};
}
export default withSearch(
diff --git a/web/js/components/layer/settings/layer-settings.js b/web/js/components/layer/settings/layer-settings.js
index 3c4687587..98e2584bf 100644
--- a/web/js/components/layer/settings/layer-settings.js
+++ b/web/js/components/layer/settings/layer-settings.js
@@ -369,7 +369,7 @@ class LayerSettings extends React.Component {
function mapStateToProps(state, ownProps) {
const {
- config, palettes, compare, browser, settings,
+ config, palettes, compare, screenSize, settings,
} = state;
const { custom } = palettes;
const groupName = compare.activeString;
@@ -388,7 +388,7 @@ function mapStateToProps(state, ownProps) {
paletteOrder: config.paletteOrder,
granuleOptions,
groupName,
- screenHeight: browser.screenHeight,
+ screenHeight: screenSize.screenHeight,
customPalettesIsActive: !!config.features.customPalettes,
globalTemperatureUnit,
palettedAllowed: isPaletteAllowed(ownProps.layer.id, config),
diff --git a/web/js/components/location-search/coordinates-dialog.js b/web/js/components/location-search/coordinates-dialog.js
index b99958e70..dd64dcb1f 100644
--- a/web/js/components/location-search/coordinates-dialog.js
+++ b/web/js/components/location-search/coordinates-dialog.js
@@ -204,7 +204,7 @@ CoordinatesDialog.propTypes = {
removeMarker: PropTypes.func,
removeCoordinatesDialog: PropTypes.func,
title: PropTypes.string,
- coordinates: PropTypes.string,
+ coordinates: PropTypes.array,
isMobile: PropTypes.bool,
tooltipId: PropTypes.string,
};
diff --git a/web/js/components/location-search/location-search-input.js b/web/js/components/location-search/location-search-input.js
index 9590cbf46..594771324 100644
--- a/web/js/components/location-search/location-search-input.js
+++ b/web/js/components/location-search/location-search-input.js
@@ -225,10 +225,15 @@ class SearchBox extends Component {
const placeHolderText = isMobile
? 'Enter place name or coordinates'
: 'Search for places or enter coordinates';
+
+ const mobileStyle = isMobile ? {
+ width: '100%',
+ } : null;
return (
<div
className="location-search-input-container"
onKeyPress={this.handleKeyPress}
+ style={mobileStyle}
>
<Autocomplete
ref={(el) => { this.locationSearchInput = el; }}
diff --git a/web/js/components/location-search/location-search-modal.js b/web/js/components/location-search/location-search-modal.js
index d05811bd0..bb67350d5 100644
--- a/web/js/components/location-search/location-search-modal.js
+++ b/web/js/components/location-search/location-search-modal.js
@@ -351,14 +351,23 @@ class LocationSearchModal extends Component {
showInputAlert,
} = this.state;
+ const locationSearchMobileStyle = isMobile ? {
+ position: 'static',
+ width: '100%',
+ } : null;
+
+ const locationSearchInputGroupMobileStyle = isMobile ? {
+ width: '100% !important',
+ } : null;
+
return (
- <div id="location-search-wrapper" className="location-search-expanded">
+ <div id="location-search-wrapper" className="location-search-expanded" style={locationSearchMobileStyle}>
{/* Alerts */}
{this.renderReverseGeocodeAlert()}
{this.renderNoSuggestionsAlert()}
{this.renderExtentAlert()}
<div className="location-search-component">
- <InputGroup className="location-search-input-group">
+ <InputGroup className="location-search-input-group" style={locationSearchInputGroupMobileStyle}>
{/* Minimize button not visible in mobile */}
{!isMobile && this.renderMinimizeButton()}
<SearchBox
@@ -385,7 +394,7 @@ class LocationSearchModal extends Component {
const mapStateToProps = (state) => {
const {
- browser,
+ screenSize,
config,
lastAction,
proj,
@@ -398,7 +407,7 @@ const mapStateToProps = (state) => {
suggestions,
suggestedPlace,
} = locationSearch;
- const isMobile = browser.lessThan.medium;
+ const isMobile = screenSize.isMobileDevice;
const locationSearchMobileModalOpen = modal.isOpen && modal.id === 'TOOLBAR_LOCATION_SEARCH_MOBILE';
// Collapse when image download, GIF, measure tool, or distraction free mode is active
const measureToggledOff = lastAction.type === 'MEASURE/TOGGLE_MEASURE_ACTIVE' && lastAction.value === false;
diff --git a/web/js/components/location-search/location-search.js b/web/js/components/location-search/location-search.js
index 35aa81964..6e35cf885 100644
--- a/web/js/components/location-search/location-search.js
+++ b/web/js/components/location-search/location-search.js
@@ -67,7 +67,7 @@ class LocationSearch extends Component {
const mapStateToProps = (state) => {
const {
- browser,
+ screenSize,
config,
modal,
measure,
@@ -81,7 +81,7 @@ const mapStateToProps = (state) => {
isExpanded,
} = locationSearch;
const { isDistractionFreeModeActive } = ui;
- const isMobile = browser.lessThan.medium;
+ const isMobile = screenSize.isMobileDevice;
const snapshotModalOpen = modal.isOpen && modal.id === 'TOOLBAR_SNAPSHOT';
// Collapse when image download, GIF, measure tool, or distraction free mode is active
const shouldCollapseFromOtherUI = snapshotModalOpen || measure.isActive || gifActive || isDistractionFreeModeActive;
diff --git a/web/js/components/location-search/ol-coordinates-marker.js b/web/js/components/location-search/ol-coordinates-marker.js
index c6b3e9743..2faec37b5 100644
--- a/web/js/components/location-search/ol-coordinates-marker.js
+++ b/web/js/components/location-search/ol-coordinates-marker.js
@@ -99,7 +99,7 @@ export class CoordinatesMarker extends Component {
function mapStateToProps(state) {
const {
- browser,
+ screenSize,
config,
map,
proj,
@@ -107,7 +107,7 @@ function mapStateToProps(state) {
locationSearch,
} = state;
const { coordinates, isCoordinateSearchActive } = locationSearch;
- const isMobile = browser.lessThan.medium;
+ const isMobile = screenSize.isMobileDevice;
return {
config,
diff --git a/web/js/components/map/loading-spinner.js b/web/js/components/map/loading-spinner.js
index dcea43459..80acd1fb1 100644
--- a/web/js/components/map/loading-spinner.js
+++ b/web/js/components/map/loading-spinner.js
@@ -4,22 +4,21 @@ import PropTypes from 'prop-types';
import { Spinner } from 'reactstrap';
function LoadingIndicator({ msg, isLoading, isMobile }) {
- const spinnerStyle = {
- position: 'absolute',
- top: 10,
- left: 300,
- zIndex: 999,
- };
-
- const mobileSpinnerStyle = {
+ const spinnerStyle = isMobile ? {
position: 'absolute',
top: 10,
left: 80,
zIndex: 999,
- };
+ }
+ : {
+ position: 'absolute',
+ top: 10,
+ left: 300,
+ zIndex: 999,
+ };
return isLoading && (
- <div style={isMobile ? mobileSpinnerStyle : spinnerStyle}>
+ <div style={spinnerStyle}>
<Spinner color="light" size="sm" />
{msg}
</div>
@@ -32,11 +31,11 @@ LoadingIndicator.propTypes = {
};
const mapStateToProps = (state) => {
- const { browser, loading } = state;
+ const { screenSize, loading } = state;
const { msg, isLoading } = loading;
return {
isLoading,
- isMobile: browser.lessThan.medium,
+ isMobile: screenSize.isMobileDevice,
msg,
};
};
diff --git a/web/js/components/map/ol-coordinates.js b/web/js/components/map/ol-coordinates.js
index 8d1b9d5a2..5123b131c 100644
--- a/web/js/components/map/ol-coordinates.js
+++ b/web/js/components/map/ol-coordinates.js
@@ -128,10 +128,16 @@ class OlCoordinates extends React.Component {
const {
hasMouse, format, latitude, longitude, crs, width,
} = this.state;
- const { show } = this.props;
+ const { show, isMobile } = this.props;
+ const coordContainerStyle = isMobile ? {
+ display: 'none',
+ }
+ : {
+ width,
+ };
return (
- <div id="ol-coords-case" className="wv-coords-container" style={{ width }}>
+ <div id="ol-coords-case" className="wv-coords-container" style={coordContainerStyle}>
{hasMouse && show && (
<>
<Coordinates
@@ -154,10 +160,12 @@ class OlCoordinates extends React.Component {
}
function mapStateToProps (state) {
- const { settings } = state;
+ const { settings, screenSize } = state;
const { coordinateFormat } = settings;
+ const isMobile = screenSize.isMobileDevice;
return {
coordinateFormat,
+ isMobile,
};
}
@@ -171,6 +179,7 @@ OlCoordinates.propTypes = {
show: PropTypes.bool,
changeCoordinateFormat: PropTypes.func,
coordinateFormat: PropTypes.string,
+ isMobile: PropTypes.bool,
};
export default connect(
diff --git a/web/js/components/map/rotation.js b/web/js/components/map/rotation.js
index 44e9754ac..edb62108b 100644
--- a/web/js/components/map/rotation.js
+++ b/web/js/components/map/rotation.js
@@ -117,9 +117,9 @@ class Rotation extends React.Component {
const mapStateToProps = (state) => {
const {
- browser, map, proj, ui,
+ screenSize, map, proj, ui,
} = state;
- const isMobile = browser.lessThan.medium;
+ const isMobile = screenSize.isMobileDevice;
return {
map,
proj,
diff --git a/web/js/components/map/zoom.js b/web/js/components/map/zoom.js
index aa988dc60..ac7405e29 100644
--- a/web/js/components/map/zoom.js
+++ b/web/js/components/map/zoom.js
@@ -54,10 +54,10 @@ function Zoom({
const mapStateToProps = (state) => {
const {
- browser, map, proj, ui,
+ screenSize, map, proj, ui,
} = state;
const activeMap = map.ui.selected;
- const isMobile = browser.lessThan.medium;
+ const isMobile = screenSize.isMobileDevice;
return {
map: activeMap,
zoomLevel: activeMap && activeMap.getView().getZoom(),
diff --git a/web/js/components/measure-tool/measure-button.js b/web/js/components/measure-tool/measure-button.js
index 0c3b0022d..2a7f3a96d 100644
--- a/web/js/components/measure-tool/measure-button.js
+++ b/web/js/components/measure-tool/measure-button.js
@@ -8,11 +8,10 @@ import MeasureMenu from './measure-menu';
import { openCustomContent } from '../../modules/modal/actions';
import AlertUtil from '../util/alert';
-
const MEASURE_MENU_PROPS = {
headerText: null,
type: 'toolbar',
- modalClassName: 'measure-tool-modal',
+ modalClassName: 'measure-tool-modal measure-mobile',
backdrop: false,
bodyComponent: MeasureMenu,
touchDevice: false,
@@ -61,6 +60,13 @@ class MeasureButton extends React.Component {
const message = isTouchDevice ? mobileHelpMsg : helpMsg;
const buttonId = 'wv-measure-button';
const labelText = 'Measure distances & areas';
+ const mobileMeasureButtonStyle = isMobile ? {
+ bottom: '20px',
+ fontSize: '14.3px',
+ height: '44px',
+ margin: '0 0 0 4px',
+ padding: '5.72px 9.1px',
+ } : null;
return (
<>
@@ -83,6 +89,7 @@ class MeasureButton extends React.Component {
onTouchEnd={this.onButtonClick}
onMouseDown={this.onButtonClick}
disabled={isActive}
+ style={mobileMeasureButtonStyle}
>
<UncontrolledTooltip
placement="top"
@@ -101,7 +108,7 @@ class MeasureButton extends React.Component {
const mapStateToProps = (state) => ({
isActive: state.measure.isActive,
isDistractionFreeModeActive: state.ui.isDistractionFreeModeActive,
- isMobile: state.browser.lessThan.medium,
+ isMobile: state.screenSize.isMobileDevice,
});
const mapDispatchToProps = (dispatch) => ({
openModal: (key, customParams) => {
diff --git a/web/js/components/measure-tool/measure-menu.js b/web/js/components/measure-tool/measure-menu.js
index 14ef9917a..7f9ae7630 100644
--- a/web/js/components/measure-tool/measure-menu.js
+++ b/web/js/components/measure-tool/measure-menu.js
@@ -119,13 +119,13 @@ class MeasureMenu extends Component {
const mapStateToProps = (state) => {
const {
- modal, map, measure, proj, browser,
+ modal, map, measure, proj, screenSize,
} = state;
const { unitOfMeasure, allMeasurements } = measure;
const { crs } = proj.selected;
const measurementsInProj = !!Object.keys(allMeasurements[crs]).length;
return {
- isMobile: browser.lessThan.medium,
+ isMobile: screenSize.isMobileDevice,
isTouchDevice: modal.customProps.touchDevice,
map,
unitOfMeasure,
diff --git a/web/js/components/sidebar/events-filter.js b/web/js/components/sidebar/events-filter.js
index fe271e367..8e10cff0b 100644
--- a/web/js/components/sidebar/events-filter.js
+++ b/web/js/components/sidebar/events-filter.js
@@ -25,6 +25,7 @@ function EventFilterModalBody (props) {
showAll,
parentId,
isPolarProj,
+ isMobile,
} = props;
const [allNone, setAllNone] = useState(!!selectedCategories.length);
@@ -80,6 +81,10 @@ function EventFilterModalBody (props) {
const minDate = new Date('2000-01-01');
const maxDate = util.now();
+ const mobileStyle = isMobile ? {
+ fontSize: '14px',
+ } : null;
+
return (
<div className="events-filter">
<DateRangeSelector
@@ -94,7 +99,7 @@ function EventFilterModalBody (props) {
<div className="category-toggles">
<div className="classification-switch-header">
- <h2 className="wv-header">Disable/Enable</h2>
+ <h2 className="wv-header" style={mobileStyle}>Disable/Enable</h2>
<Switch
id="header-disable"
label="All"
@@ -174,10 +179,13 @@ EventFilterModalBody.propTypes = {
selectedEndDate: PropTypes.string,
setFilter: PropTypes.func,
showAll: PropTypes.bool,
+ isMobile: PropTypes.bool,
};
const mapStateToProps = (state) => {
- const { events, proj, config } = state;
+ const {
+ events, proj, config, screenSize,
+ } = state;
const {
selectedCategories, selectedDates, showAll,
} = events;
@@ -191,6 +199,8 @@ const mapStateToProps = (state) => {
selectedStartDate: selectedDates.start,
selectedEndDate: selectedDates.end,
showAll,
+ isMobile: screenSize.isMobileDevice,
+ screenHeight: screenSize.screenHeight,
};
};
diff --git a/web/js/components/sidebar/nav/nav-case.js b/web/js/components/sidebar/nav/nav-case.js
index 0de20aa3a..026e8ff4e 100644
--- a/web/js/components/sidebar/nav/nav-case.js
+++ b/web/js/components/sidebar/nav/nav-case.js
@@ -67,6 +67,15 @@ function NavCase (props) {
}
/>
);
+ const sidebarCollapseMobile = isMobile ? {
+ height: '48px',
+ width: '45px',
+ } : null;
+ const collapseIconMobile = isMobile ? {
+ height: '40px',
+ width: '40px',
+ color: '#fff',
+ } : null;
return (
<Nav tabs className="main-nav">
@@ -88,11 +97,17 @@ function NavCase (props) {
{!isEventsTabDisabledEmbed && renderEvents()}
{renderDataDownload()}
- <div id="toggleIconHolder" className="sidebar-collapse" onClick={toggleSidebar}>
+ <div
+ id="toggleIconHolder"
+ className="sidebar-collapse"
+ onClick={toggleSidebar}
+ style={sidebarCollapseMobile}
+ >
<FontAwesomeIcon
className="collapse-icon"
icon="caret-up"
aria-label="Hide sidebar"
+ style={collapseIconMobile}
/>
<UncontrolledTooltip placement="right" target="toggleIconHolder">
Hide sidebar
diff --git a/web/js/components/sidebar/paletteLegend.js b/web/js/components/sidebar/paletteLegend.js
index 00af8dc4b..8679f69c3 100644
--- a/web/js/components/sidebar/paletteLegend.js
+++ b/web/js/components/sidebar/paletteLegend.js
@@ -248,6 +248,12 @@ class PaletteLegend extends React.Component {
min = units ? `${min} ${units}` : min;
max = units ? `${max} ${units}` : max;
}
+ const mobileColorbarStyle = isMobile ? {
+ width: '100%',
+ maxWidth: '100%',
+ marginRight: '0',
+ marginLeft: '0',
+ } : null;
return (
<div
className={
@@ -264,6 +270,7 @@ class PaletteLegend extends React.Component {
<canvas
className="wv-palettes-colorbar"
id={`${util.encodeId(layer.id)}-${util.encodeId(legend.id)}${index}colorbar`}
+ style={mobileColorbarStyle}
width={width}
height={24}
ref={this[`canvas_${index}`]}
diff --git a/web/js/containers/alerts.js b/web/js/containers/alerts.js
index b4f79d034..20bbc3f7a 100644
--- a/web/js/containers/alerts.js
+++ b/web/js/containers/alerts.js
@@ -162,7 +162,7 @@ const mapDispatchToProps = (dispatch) => ({
});
const mapStateToProps = (state) => {
const {
- browser, embed, events, sidebar, compare, alerts, ui, animation,
+ embed, events, sidebar, compare, alerts, ui, animation, screenSize,
} = state;
const { isVectorZoomAlertPresent, isVectorExceededAlertPresent } = alerts;
const activeLayers = getActiveLayers(state);
@@ -173,8 +173,8 @@ const mapStateToProps = (state) => {
isDistractionFreeModeActive: ui.isDistractionFreeModeActive,
isEmbedModeActive: embed.isEmbedModeActive,
isEventsActive: !!(events.selected.id && sidebar.activeTab === 'events'),
- isSmall: browser.lessThan.small,
- isMobile: browser.lessThan.medium,
+ isSmall: screenSize.screenWidth < screenSize.breakpoints.small,
+ isMobile: screenSize.isMobileDevice,
isAnimationActive: animation.isActive,
isVectorZoomAlertPresent: hasActiveVectorLayers && isVectorZoomAlertPresent,
isVectorExceededAlertPresent: hasActiveVectorLayers && isVectorExceededAlertPresent,
diff --git a/web/js/containers/animation-widget.js b/web/js/containers/animation-widget.js
index 92db1ced4..a9dfe7e8b 100644
--- a/web/js/containers/animation-widget.js
+++ b/web/js/containers/animation-widget.js
@@ -492,7 +492,7 @@ function mapStateToProps(state) {
modal,
config,
map,
- browser,
+ screenSize,
ui,
proj,
} = state;
@@ -563,7 +563,7 @@ function mapStateToProps(state) {
return {
appNow,
- screenWidth: browser.screenWidth,
+ screenWidth: screenSize.screenWidth,
animationCustomModalOpen,
customSelected,
startDate,
@@ -574,8 +574,8 @@ function mapStateToProps(state) {
maxDate,
isActive: animationIsActive,
isDistractionFreeModeActive,
- isMobile: browser.lessThan.medium,
- isLandscape: browser.orientation === 'landscape',
+ isMobile: screenSize.isMobileDevice,
+ isLandscape: screenSize.orientation === 'landscape',
hasFutureLayers,
hasSubdailyLayers,
subDailyMode,
diff --git a/web/js/containers/embed.js b/web/js/containers/embed.js
index a2af217bf..597b8aa37 100644
--- a/web/js/containers/embed.js
+++ b/web/js/containers/embed.js
@@ -66,9 +66,9 @@ function Embed (props) {
}
function mapStateToProps(state) {
- const { browser, embed } = state;
+ const { screenSize, embed } = state;
const { isEmbedModeActive } = embed;
- const isMobile = browser.lessThan.medium;
+ const isMobile = screenSize.isMobileDevice;
return {
isEmbedModeActive,
diff --git a/web/js/containers/gif.js b/web/js/containers/gif.js
index becae726f..462ac0aaa 100644
--- a/web/js/containers/gif.js
+++ b/web/js/containers/gif.js
@@ -390,12 +390,12 @@ class GIF extends Component {
function mapStateToProps(state) {
const {
- browser, proj, animation, map, date, config,
+ screenSize, proj, animation, map, date, config,
} = state;
const {
speed, startDate, endDate, boundaries,
} = animation;
- const { screenWidth, screenHeight } = browser;
+ const { screenWidth, screenHeight } = screenSize;
const {
customSelected, interval, customInterval, customDelta,
} = date;
diff --git a/web/js/containers/image-download.js b/web/js/containers/image-download.js
index 4759b21c6..b1dc8e257 100644
--- a/web/js/containers/image-download.js
+++ b/web/js/containers/image-download.js
@@ -230,7 +230,7 @@ function mapStateToProps(state) {
const {
config,
proj,
- browser,
+ screenSize,
locationSearch,
map,
imageDownload,
@@ -238,7 +238,7 @@ function mapStateToProps(state) {
const {
isWorldfile, fileType, resolution, boundaries,
} = imageDownload;
- const { screenWidth, screenHeight } = browser;
+ const { screenWidth, screenHeight } = screenSize;
const markerCoordinates = locationSearch.coordinates;
const hasSubdailyLayers = subdailyLayersActive(state);
let url = DEFAULT_URL;
diff --git a/web/js/containers/info.js b/web/js/containers/info.js
index 7a326c989..e95645f77 100644
--- a/web/js/containers/info.js
+++ b/web/js/containers/info.js
@@ -166,7 +166,7 @@ function InfoList (props) {
function mapStateToProps(state) {
const {
- ui, feedback, tour, notifications, config, models, browser,
+ ui, feedback, tour, notifications, config, models, screenSize,
} = state;
const { isDistractionFreeModeActive } = ui;
const { features: { feedback: feedbackEnabled } } = config;
@@ -179,7 +179,7 @@ function mapStateToProps(state) {
notifications,
config,
models,
- isMobile: browser.lessThan.medium,
+ isMobile: screenSize.isMobileDevice,
};
}
const mapDispatchToProps = (dispatch) => ({
diff --git a/web/js/containers/map-interactions/ol-vector-interactions.js b/web/js/containers/map-interactions/ol-vector-interactions.js
index 1de1e37c4..27d7ef324 100644
--- a/web/js/containers/map-interactions/ol-vector-interactions.js
+++ b/web/js/containers/map-interactions/ol-vector-interactions.js
@@ -172,7 +172,7 @@ export class VectorInteractions extends React.Component {
singleClick(e, map) {
const {
- browser, lastSelected, openVectorDialog, onCloseModal, selectVectorFeatures,
+ screenSize, lastSelected, openVectorDialog, onCloseModal, selectVectorFeatures,
modalState, getDialogObject, measureIsActive, activeLayers, isCoordinateSearchActive,
activateVectorZoomAlert, activateVectorExceededResultsAlert, clearVectorExceededResultsAlert,
proj, isEmbedModeActive, isVectorExceededAlertPresent, isMobile,
@@ -199,7 +199,7 @@ export class VectorInteractions extends React.Component {
if (hasNonClickableVectorLayerType) {
activateVectorZoomAlert();
} else {
- openVectorDialog(dialogId, metaArray, offsetLeft, offsetTop, browser, isEmbedModeActive);
+ openVectorDialog(dialogId, metaArray, offsetLeft, offsetTop, screenSize, isEmbedModeActive);
if (exceededLengthLimit) {
activateVectorExceededResultsAlert();
} else if (isVectorExceededAlertPresent) {
@@ -226,7 +226,7 @@ export class VectorInteractions extends React.Component {
function mapStateToProps(state) {
const {
animation,
- browser,
+ screenSize,
compare,
config,
map,
@@ -252,7 +252,7 @@ function mapStateToProps(state) {
let swipeOffset;
if (active && mode === 'swipe') {
const percentOffset = value || 50;
- swipeOffset = browser.screenWidth * (percentOffset / 100);
+ swipeOffset = screenSize.screenWidth * (percentOffset / 100);
}
const granuleFootprints = getActiveGranuleFootPrints(state);
@@ -263,7 +263,7 @@ function mapStateToProps(state) {
return {
activeLayers,
- browser,
+ screenSize,
isCoordinateSearchActive,
compareState: compare,
getDialogObject: (pixels, olMap) => onMapClickGetVectorFeatures(pixels, olMap, state, swipeOffset),
@@ -274,7 +274,7 @@ function mapStateToProps(state) {
lastSelected: vectorStyles.selected,
measureIsActive: measure.isActive,
isPlaying,
- isMobile: browser.lessThan.medium,
+ isMobile: screenSize.isMobileDevice,
granuleFootprints,
granulePlatform,
swipeOffset,
@@ -302,9 +302,9 @@ const mapDispatchToProps = (dispatch) => ({
activateVectorZoomAlert: () => dispatch({ type: ACTIVATE_VECTOR_ZOOM_ALERT }),
activateVectorExceededResultsAlert: () => dispatch({ type: ACTIVATE_VECTOR_EXCEEDED_ALERT }),
clearVectorExceededResultsAlert: () => dispatch({ type: DISABLE_VECTOR_EXCEEDED_ALERT }),
- openVectorDialog: (dialogId, metaArray, offsetLeft, offsetTop, browser, isEmbedModeActive) => {
- const { screenHeight, screenWidth } = browser;
- const isMobile = browser.lessThan.medium;
+ openVectorDialog: (dialogId, metaArray, offsetLeft, offsetTop, screenSize, isEmbedModeActive) => {
+ const { screenHeight, screenWidth } = screenSize;
+ const isMobile = screenSize.isMobileDevice;
const dialogKey = new Date().getUTCMilliseconds();
const modalClassName = isEmbedModeActive && !isMobile ? 'vector-modal light modal-embed' : 'vector-modal light';
const mobileTopOffset = 106;
@@ -354,7 +354,7 @@ VectorInteractions.propTypes = {
activateVectorExceededResultsAlert: PropTypes.func,
clearVectorExceededResultsAlert: PropTypes.func,
activeLayers: PropTypes.array,
- browser: PropTypes.object,
+ screenSize: PropTypes.object,
isEmbedModeActive: PropTypes.bool,
isVectorExceededAlertPresent: PropTypes.bool,
isCoordinateSearchActive: PropTypes.bool,
diff --git a/web/js/containers/modal.js b/web/js/containers/modal.js
index 962962d72..a4c8e020b 100644
--- a/web/js/containers/modal.js
+++ b/web/js/containers/modal.js
@@ -77,7 +77,7 @@ class ModalContainer extends Component {
const { mobileFullScreen } = customProps;
const mobileTopOffset = 106;
const top = isMobile && mobileFullScreen ? mobileTopOffset : offsetTop;
- const margin = isMobile && mobileFullScreen ? 0 : '0.5rem auto';
+ const margin = isMobile ? 0 : '0.5rem auto';
return {
left: offsetLeft,
right: offsetRight,
@@ -248,7 +248,7 @@ class ModalContainer extends Component {
}
function mapStateToProps(state) {
- const { browser, embed, modal } = state;
+ const { embed, modal, screenSize } = state;
const {
bodyText,
headerText,
@@ -265,9 +265,9 @@ function mapStateToProps(state) {
isTemplateModal = true;
}
const {
- screenHeight, screenWidth, lessThan, orientation,
- } = browser;
- const isMobile = lessThan.medium;
+ screenHeight, screenWidth, orientation, isMobileDevice,
+ } = screenSize;
+ const isMobile = isMobileDevice;
const { isEmbedModeActive } = embed;
return {
bodyTemplate,
diff --git a/web/js/containers/projection.js b/web/js/containers/projection.js
index 289a70e7a..8b271dea2 100644
--- a/web/js/containers/projection.js
+++ b/web/js/containers/projection.js
@@ -78,13 +78,13 @@ class ProjectionList extends Component {
const mapStateToProps = (state) => {
const {
- config, models, proj, browser,
+ config, models, proj, screenSize,
} = state;
const projArray = lodashGet(config, 'ui.projections');
const projectionArray = projArray
? getInfoArray(projArray)
: DEFAULT_PROJ_ARRAY;
- const isMobile = browser.lessThan.medium;
+ const isMobile = screenSize.isMobileDevice;
return {
models,
isMobile,
diff --git a/web/js/containers/share.js b/web/js/containers/share.js
index 34d0d2c9d..a3199f7ab 100644
--- a/web/js/containers/share.js
+++ b/web/js/containers/share.js
@@ -343,11 +343,11 @@ class ShareLinkContainer extends Component {
function mapStateToProps(state) {
const {
- browser, config, shortLink, sidebar, tour,
+ screenSize, config, shortLink, sidebar, tour,
} = state;
const { features: { urlShortening } } = config;
- const isMobile = browser.lessThan.medium;
+ const isMobile = screenSize.isMobileDevice;
const embedDisableNavLink = sidebar.activeTab === 'download' || tour.active;
return {
diff --git a/web/js/containers/sidebar/compare.js b/web/js/containers/sidebar/compare.js
index 784b6292a..f8cfcebc7 100644
--- a/web/js/containers/sidebar/compare.js
+++ b/web/js/containers/sidebar/compare.js
@@ -85,15 +85,17 @@ const mapDispatchToProps = (dispatch) => ({
});
const mapStateToProps = (state) => {
- const { compare } = state;
+ const { compare, screenSize } = state;
const { isCompareA, active } = compare;
const { dateA, dateB } = getCompareDates(state);
+ const isMobile = screenSize.isMobileDevice;
return {
isCompareA,
dateA,
dateB,
isActive: active,
+ isMobile,
};
};
diff --git a/web/js/containers/sidebar/events.js b/web/js/containers/sidebar/events.js
index 652aa119a..73aa02128 100644
--- a/web/js/containers/sidebar/events.js
+++ b/web/js/containers/sidebar/events.js
@@ -6,6 +6,7 @@ import {
Button,
} from 'reactstrap';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
+import { isMobileOnly, isTablet } from 'react-device-detect';
import Event from '../../components/sidebar/event';
import EventIcon from '../../components/sidebar/event-icon';
import EventFilterModalBody from '../../components/sidebar/events-filter';
@@ -86,7 +87,6 @@ function Events(props) {
</Button>
</div>
);
-
const renderEventList = () => (
eventsData && eventsData.length ? (
<div className="wv-eventslist sidebar-panel">
@@ -146,7 +146,7 @@ const mapDispatchToProps = (dispatch) => ({
backdrop: false,
bodyComponent: EventFilterModalBody,
footer: true,
- modalClassName: 'sidebar-modal event-filter-modal',
+ modalClassName: isMobileOnly || isTablet ? 'sidebar-modal-mobile event-filter-modal-mobile' : 'sidebar-modal event-filter-modal',
timeout: 150,
}));
},
@@ -156,8 +156,8 @@ const mapStateToProps = (state) => {
const {
animation,
embed,
- browser,
events,
+ screenSize,
} = state;
const {
@@ -167,7 +167,7 @@ const mapStateToProps = (state) => {
return {
isPlaying: animation.isPlaying,
- isMobile: browser.lessThan.medium,
+ isMobile: screenSize.isMobileDevice,
isEmbedModeActive,
isAnimatingToEvent: events.isAnimatingToEvent,
showAll,
diff --git a/web/js/containers/sidebar/footer-content.js b/web/js/containers/sidebar/footer-content.js
index fd2647574..414b3f117 100644
--- a/web/js/containers/sidebar/footer-content.js
+++ b/web/js/containers/sidebar/footer-content.js
@@ -20,6 +20,8 @@ const FooterContent = React.forwardRef((props, ref) => {
isCompareActive,
compareMode,
isMobile,
+ breakpoints,
+ screenWidth,
isPlaying,
activeTab,
changeCompareMode,
@@ -34,7 +36,7 @@ const FooterContent = React.forwardRef((props, ref) => {
const onClickAddLayers = (e) => {
e.stopPropagation();
- addLayers(isPlaying);
+ addLayers(isPlaying, isMobile, breakpoints, screenWidth);
googleTagManager.pushEvent({ event: 'add_layers' });
};
@@ -103,7 +105,6 @@ const FooterContent = React.forwardRef((props, ref) => {
);
};
-
return (
<footer ref={ref}>
{activeTab === 'layers' && renderLayersFooter()}
@@ -112,6 +113,25 @@ const FooterContent = React.forwardRef((props, ref) => {
);
});
+const mapStateToProps = (state) => {
+ const {
+ animation, config, compare, screenSize,
+ } = state;
+ const { isPlaying } = animation;
+ const eventsData = getFilteredEvents(state);
+
+ return {
+ isMobile: screenSize.isMobileDevice,
+ breakpoints: screenSize.breakpoints,
+ screenWidth: screenSize.screenWidth,
+ isPlaying,
+ compareFeature: config.features.compare,
+ isCompareActive: compare.active,
+ compareMode: compare.mode,
+ eventsData,
+ };
+};
+
const mapDispatchToProps = (dispatch) => ({
toggleCompare: () => {
dispatch(toggleCompareOnOff());
@@ -119,14 +139,15 @@ const mapDispatchToProps = (dispatch) => ({
changeCompareMode: (str) => {
dispatch(changeMode(str));
},
- addLayers: (isPlaying) => {
+ addLayers: (isPlaying, isMobile, breakpoints, screenWidth) => {
+ const modalClassName = isMobile || screenWidth < breakpoints.medium ? 'custom-layer-dialog-mobile custom-layer-dialog light' : 'custom-layer-dialog light';
if (isPlaying) {
dispatch(stopAnimationAction());
}
dispatch(
openCustomContent('LAYER_PICKER_COMPONENT', {
headerText: null,
- modalClassName: 'custom-layer-dialog light',
+ modalClassName,
backdrop: true,
CompletelyCustomModal: SearchUiProvider,
wrapClassName: '',
@@ -135,23 +156,6 @@ const mapDispatchToProps = (dispatch) => ({
},
});
-const mapStateToProps = (state) => {
- const {
- animation, config, compare, browser,
- } = state;
- const { isPlaying } = animation;
- const eventsData = getFilteredEvents(state);
-
- return {
- isMobile: browser.lessThan.medium,
- isPlaying,
- compareFeature: config.features.compare,
- isCompareActive: compare.active,
- compareMode: compare.mode,
- eventsData,
- };
-};
-
export default connect(
mapStateToProps,
mapDispatchToProps,
@@ -168,6 +172,8 @@ FooterContent.propTypes = {
eventsData: PropTypes.array,
isCompareActive: PropTypes.bool,
isMobile: PropTypes.bool,
+ screenWidth: PropTypes.number,
+ breakpoints: PropTypes.object,
isPlaying: PropTypes.bool,
toggleCompare: PropTypes.func,
};
diff --git a/web/js/containers/sidebar/layer-list.js b/web/js/containers/sidebar/layer-list.js
index 11a32ac3b..18ce7de08 100644
--- a/web/js/containers/sidebar/layer-list.js
+++ b/web/js/containers/sidebar/layer-list.js
@@ -216,7 +216,7 @@ LayerList.propTypes = {
const mapStateToProps = (state, ownProps) => {
const {
- embed, proj, config, map, animation,
+ embed, proj, config, map, animation, screenSize,
} = state;
const { isEmbedModeActive } = embed;
const zots = lodashGet(map, 'ui.selected')
@@ -230,7 +230,7 @@ const mapStateToProps = (state, ownProps) => {
return {
zots,
isEmbedModeActive,
- isMobile: state.browser.lessThan.medium,
+ isMobile: screenSize.isMobileDevice,
activeLayers,
projId: proj.id,
getNames: (layerId) => getTitles(config, layerId, proj.id),
diff --git a/web/js/containers/sidebar/layer-row.js b/web/js/containers/sidebar/layer-row.js
index 9cec8cf38..55b627118 100644
--- a/web/js/containers/sidebar/layer-row.js
+++ b/web/js/containers/sidebar/layer-row.js
@@ -417,9 +417,9 @@ const makeMapStateToProps = () => {
compareState,
} = ownProps;
const {
- browser, palettes, config, embed, map, compare, proj, ui, settings, animation,
+ screenSize, palettes, config, embed, map, compare, proj, ui, settings, animation,
} = state;
- const isMobile = browser.lessThan.medium;
+ const isMobile = screenSize.isMobileDevice;
const { isDistractionFreeModeActive } = ui;
const globalTemperatureUnit = lodashGet(ownProps, 'layer.disableUnitConversion') ? '' : settings.globalTemperatureUnit;
const hasPalette = !lodashIsEmpty(layer.palette);
diff --git a/web/js/containers/sidebar/layers-container.js b/web/js/containers/sidebar/layers-container.js
index cba981958..0d0d0e564 100644
--- a/web/js/containers/sidebar/layers-container.js
+++ b/web/js/containers/sidebar/layers-container.js
@@ -126,7 +126,6 @@ function LayersContainer (props) {
};
const shouldHideForEmbedNoOverlays = isEmbedModeActive && overlays.length === 0;
const shouldHideForEmbedNoBaseLayers = isEmbedModeActive && baselayers.length === 0;
-
return isActive && (
<>
<div id="layers-scroll-container" style={scrollContainerStyles}>
@@ -174,11 +173,11 @@ function LayersContainer (props) {
const mapStateToProps = (state, ownProps) => {
const { compareState } = ownProps;
const {
- browser, compare, embed, layers, animation,
+ compare, embed, layers, animation, screenSize,
} = state;
const isCompareActive = compare.active;
const { isEmbedModeActive } = embed;
- const isMobile = browser.lessThan.medium;
+ const isMobile = screenSize.isMobileDevice;
const { groupOverlays } = layers[compareState];
const activeLayersMap = getActiveLayersMap(state);
let { baselayers, overlays } = getAllActiveOverlaysBaselayers(state);
diff --git a/web/js/containers/sidebar/orbit-track.js b/web/js/containers/sidebar/orbit-track.js
index db9bcf954..3719955cb 100644
--- a/web/js/containers/sidebar/orbit-track.js
+++ b/web/js/containers/sidebar/orbit-track.js
@@ -74,7 +74,9 @@ function mapStateToProps(state, ownProps) {
trackLayer,
compareState,
} = ownProps;
- const { palettes, config, ui } = state;
+ const {
+ palettes, config, ui, screenSize,
+ } = state;
const { isDistractionFreeModeActive } = ui;
const renderedPalettes = palettes.rendered;
const hasPalette = !lodashIsEmpty(trackLayer.palette);
@@ -90,7 +92,7 @@ function mapStateToProps(state, ownProps) {
isCustomPalette,
isLoading: palettes.isLoading[paletteName],
renderedPalette: renderedPalettes[paletteName],
- isMobile: state.browser.lessThan.medium,
+ isMobile: screenSize.isMobileDevice,
isDistractionFreeModeActive,
hasPalette,
getPalette: (layerId, index) => getPaletteSelector(trackLayer.id, index, compareState, state),
diff --git a/web/js/containers/sidebar/sidebar.js b/web/js/containers/sidebar/sidebar.js
index 69e510c4d..4dbdc72a3 100644
--- a/web/js/containers/sidebar/sidebar.js
+++ b/web/js/containers/sidebar/sidebar.js
@@ -192,12 +192,45 @@ class Sidebar extends React.Component {
isDistractionFreeModeActive,
isEmbedModeActive,
selectedDate,
+ isMobile,
} = this.props;
const permalink = getPermalink(history.location.search, selectedDate);
const WVLogoTitle = isEmbedModeActive
? 'Click to Open This @NAME@ Map in a New Tab'
: 'Click to Reset @NAME@ to Defaults';
const embedWVLogoLink = isEmbedModeActive ? permalink : '/';
+ const mobileImgURL = '../../../brand/images/wv-logo-mobile.svg?v=@BUILD_NONCE@';
+ const desktopImgURL = '../../../brand/images/wv-logo.svg?v=@BUILD_NONCE@';
+
+ const sidebarStyle = isMobile ? {
+ background: `url(${mobileImgURL}) no-repeat center rgb(40 40 40 / 85%)`,
+ display: 'block',
+ height: '42px',
+ width: '56px',
+ padding: '5px',
+ top: '10px',
+ left: '10px',
+ borderRadius: '5px',
+ border: '1px solid #333',
+ position: 'absolute',
+ }
+ : {
+ background: `url(${desktopImgURL}) no-repeat center rgb(40 40 40 / 85%)`,
+ display: 'block',
+ width: '286px',
+ height: '55px',
+ padding: '5px 0',
+ position: 'absolute',
+ top: '10px',
+ left: '10px',
+ borderRight: '1px solid #333',
+ borderLeft: '1px solid #333',
+ borderTop: '1px solid #333',
+ borderBottom: 'transparent',
+ borderTopRightRadius: '5px',
+ borderTopLeftRadius: '5px',
+ boxSizing: 'border-box',
+ };
return (
<a
@@ -205,6 +238,7 @@ class Sidebar extends React.Component {
title={WVLogoTitle}
id="wv-logo"
className={isDistractionFreeModeActive ? 'wv-logo-distraction-free-mode' : ''}
+ style={sidebarStyle}
onClick={(e) => this.handleWorldviewLogoClick(e, permalink)}
/>
);
@@ -243,9 +277,34 @@ class Sidebar extends React.Component {
: isEmbedModeActive
? '95vh'
: `${screenHeight}px`;
+ const displayStyle = isDistractionFreeModeActive ? 'none' : 'block';
+
+ const mobileWVSidebarStyle = !isDistractionFreeModeActive && isMobile ? {
+ position: 'static',
+ } : null;
+
+ const productsHolderStyle = isDistractionFreeModeActive ? {
+ display: 'none',
+ } : !isDistractionFreeModeActive && isMobile && !isEmbedModeActive ? {
+ cssFloat: 'left',
+ left: '0',
+ minWidth: '238px',
+ width: '100%',
+ height: '100%',
+ position: 'absolute !important',
+ overflow: 'hidden',
+ background: 'rgb(38 43 49)',
+ top: '0',
+ zIndex: 1000,
+ maxHeight: `${maxHeight}`,
+ display: `{${displayStyle}} !important`,
+ } : {
+ maxHeight: `${maxHeight}`,
+ };
+
return (
<ErrorBoundary>
- <section id="wv-sidebar">
+ <section id="wv-sidebar" style={mobileWVSidebarStyle}>
{this.renderSidebarLogo()}
<>
{!isDistractionFreeModeActive && isCollapsed && (
@@ -259,10 +318,7 @@ class Sidebar extends React.Component {
<div
id="products-holder"
className="products-holder-case"
- style={{
- maxHeight,
- display: isDistractionFreeModeActive ? 'none' : 'block',
- }}
+ style={productsHolderStyle}
>
{!isCollapsed && (
<>
@@ -320,7 +376,6 @@ class Sidebar extends React.Component {
const mapStateToProps = (state) => {
const {
animation,
- browser,
compare,
config,
embed,
@@ -330,6 +385,7 @@ const mapStateToProps = (state) => {
map,
requestedEvents,
requestedEventSources,
+ screenSize,
sidebar,
ui,
} = state;
@@ -341,7 +397,7 @@ const mapStateToProps = (state) => {
const eventsData = getFilteredEvents(state);
const eventsSources = lodashGet(requestedEventSources, 'response');
- const { screenHeight } = browser;
+ const { screenHeight } = screenSize;
const { isDistractionFreeModeActive } = ui;
const { isEmbedModeActive } = embed;
const { activeTab, isCollapsed, mobileCollapsed } = sidebar;
@@ -353,7 +409,7 @@ const mapStateToProps = (state) => {
}
const tabTypes = getActiveTabs(config);
const snapshotModalOpen = modal.isOpen && modal.id === 'TOOLBAR_SNAPSHOT';
- const isMobile = browser.lessThan.medium;
+ const isMobile = screenSize.isMobileDevice;
// Collapse when Image download / GIF / is open or measure tool active
const shouldBeCollapsed = snapshotModalOpen || measure.isActive || animation.gifActive;
const selectedMap = map && map.ui && map.ui.selected;
diff --git a/web/js/containers/sidebar/smart-handoff.js b/web/js/containers/sidebar/smart-handoff.js
index 003a1c5d6..c3f9e0d22 100644
--- a/web/js/containers/sidebar/smart-handoff.js
+++ b/web/js/containers/sidebar/smart-handoff.js
@@ -620,12 +620,12 @@ class SmartHandoff extends Component {
const mapStateToProps = (state) => {
const {
- browser, map, proj, smartHandoffs,
+ screenSize, map, proj, smartHandoffs,
} = state;
const {
conceptId, layerId, availableTools, validatedConceptIds, validatedLayers, isLoadingTools, isValidatingCollections, requestFailed,
} = smartHandoffs;
- const { screenWidth, screenHeight } = browser;
+ const { screenWidth, screenHeight } = screenSize;
const granuleLayers = getActiveGranuleLayers(state);
const selectedDate = getSelectedDate(state);
diff --git a/web/js/containers/timeline/timeline.js b/web/js/containers/timeline/timeline.js
index faff4b260..ee784f145 100644
--- a/web/js/containers/timeline/timeline.js
+++ b/web/js/containers/timeline/timeline.js
@@ -1268,7 +1268,6 @@ class Timeline extends React.Component {
function mapStateToProps(state) {
const {
animation,
- browser,
compare,
config,
date,
@@ -1278,6 +1277,7 @@ function mapStateToProps(state) {
map,
modal,
proj,
+ screenSize,
sidebar,
tour,
ui,
@@ -1292,12 +1292,12 @@ function mapStateToProps(state) {
selectedZoom,
timelineCustomModalOpen,
} = date;
- const { screenWidth } = browser;
+ const { screenWidth } = screenSize;
const { isCompareA } = compare;
const isCompareModeActive = compare.active;
const { isDistractionFreeModeActive } = ui;
const { isEmbedModeActive } = embed;
- const isMobile = browser.lessThan.medium;
+ const isMobile = screenSize.isMobileDevice;
const { isAnimatingToEvent } = events;
// handle active layer filtering and check for subdaily
diff --git a/web/js/containers/toolbar.js b/web/js/containers/toolbar.js
index 80374c17e..d9e95a12f 100644
--- a/web/js/containers/toolbar.js
+++ b/web/js/containers/toolbar.js
@@ -177,14 +177,26 @@ class toolbarContainer extends Component {
}
renderShareButton() {
- const { faSize, openModal, isDistractionFreeModeActive } = this.props;
+ const {
+ faSize,
+ openModal,
+ isDistractionFreeModeActive,
+ isMobile,
+ } = this.props;
const buttonId = 'wv-share-button';
const labelText = 'Share this map';
+ const mobileWvToolbarButtonStyle = isMobile ? {
+ fontSize: '14.3px',
+ height: '44px',
+ margin: '0 0 0 4px',
+ padding: '5.72px 9.1px',
+ } : null;
return !isDistractionFreeModeActive && (
<Button
id={buttonId}
className="wv-toolbar-button"
aria-label={labelText}
+ style={mobileWvToolbarButtonStyle}
onClick={() => openModal(
'TOOLBAR_SHARE',
CUSTOM_MODAL_PROPS.TOOLBAR_SHARE,
@@ -203,6 +215,7 @@ class toolbarContainer extends Component {
isDistractionFreeModeActive,
openModal,
isAnimatingToEvent,
+ isMobile,
} = this.props;
const buttonId = 'wv-proj-button';
const labelText = 'Switch projection';
@@ -210,6 +223,12 @@ class toolbarContainer extends Component {
'TOOLBAR_PROJECTION',
CUSTOM_MODAL_PROPS.TOOLBAR_PROJECTION,
);
+ const mobileWvToolbarButtonStyle = isMobile ? {
+ fontSize: '14.3px',
+ height: '44px',
+ margin: '0 0 0 4px',
+ padding: '5.72px 9.1px',
+ } : null;
return config.ui && config.ui.projections && !isDistractionFreeModeActive && (
<Button
id={buttonId}
@@ -217,6 +236,7 @@ class toolbarContainer extends Component {
aria-label={labelText}
onClick={onClick}
disabled={isAnimatingToEvent}
+ style={mobileWvToolbarButtonStyle}
>
{this.renderTooltip(buttonId, labelText)}
<FontAwesomeIcon icon="globe-asia" size={faSize} />
@@ -251,6 +271,12 @@ class toolbarContainer extends Component {
: () => toggleShowLocationSearch();
const showButton = (isMobile || (!isMobile && !isLocationSearchExpanded) || shouldBeCollapsed) && !isDistractionFreeModeActive;
+ const mobileWvToolbarButtonStyle = isMobile ? {
+ fontSize: '14.3px',
+ height: '44px',
+ margin: '0 0 0 4px',
+ padding: '5.72px 9.1px',
+ } : null;
return showButton && (
<div id="location-search-wrapper">
<Button
@@ -258,6 +284,7 @@ class toolbarContainer extends Component {
className="wv-toolbar-button"
aria-label={labelText}
onClick={handleButtonClick}
+ style={mobileWvToolbarButtonStyle}
>
{this.renderTooltip(buttonId, labelText)}
<FontAwesomeIcon icon="search-location" size={faSize} />
@@ -272,6 +299,7 @@ class toolbarContainer extends Component {
isImageDownloadActive,
isCompareActive,
isDistractionFreeModeActive,
+ isMobile,
} = this.props;
const buttonId = 'wv-image-button';
const labelText = isCompareActive
@@ -279,6 +307,9 @@ class toolbarContainer extends Component {
: !isImageDownloadActive
? 'You must exit data download mode to use the snapshot feature'
: 'Take a snapshot';
+ const mobileWVImageButtonStyle = isMobile ? {
+ display: 'none',
+ } : null;
return !isDistractionFreeModeActive && (
<div id="snapshot-btn-wrapper">
@@ -293,6 +324,7 @@ class toolbarContainer extends Component {
disabled={!isImageDownloadActive}
aria-label={labelText}
onClick={this.openImageDownload}
+ style={mobileWVImageButtonStyle}
>
<FontAwesomeIcon icon="camera" size={faSize} />
</Button>
@@ -308,12 +340,19 @@ class toolbarContainer extends Component {
notificationType,
notificationContentNumber,
isDistractionFreeModeActive,
+ isMobile,
} = this.props;
const notificationClass = notificationType
? ` wv-status-${notificationType}`
: ' wv-status-hide';
const buttonId = 'wv-info-button';
const labelText = 'Information';
+ const mobileWvToolbarButtonStyle = isMobile ? {
+ fontSize: '14.3px',
+ height: '44px',
+ margin: '0 0 0 4px',
+ padding: '5.72px 9.1px',
+ } : null;
return !isDistractionFreeModeActive && (
<Button
@@ -322,6 +361,7 @@ class toolbarContainer extends Component {
className={`wv-toolbar-button${notificationClass}`}
onClick={() => openModal('TOOLBAR_INFO', CUSTOM_MODAL_PROPS.TOOLBAR_INFO)}
data-content={notificationContentNumber}
+ style={mobileWvToolbarButtonStyle}
>
{this.renderTooltip(buttonId, labelText)}
<FontAwesomeIcon icon="info-circle" size={faSize} />
@@ -331,8 +371,14 @@ class toolbarContainer extends Component {
renderDistractionFreeExitButton() {
const {
- faSize, isDistractionFreeModeActive, toggleDistractionFreeModeAction,
+ faSize, isDistractionFreeModeActive, toggleDistractionFreeModeAction, isMobile,
} = this.props;
+ const mobileButtonStyle = isMobile ? {
+ fontSize: '14.3px',
+ height: '44px',
+ margin: '0 0 0 4px',
+ padding: '5.72px 9.1px',
+ } : null;
const buttonId = 'wv-exit-distraction-free-mode-button';
const labelText = 'Exit distraction free mode';
return isDistractionFreeModeActive && (
@@ -341,6 +387,7 @@ class toolbarContainer extends Component {
className="wv-toolbar-button wv-exit-distraction-free-mode-button"
aria-label={labelText}
onClick={() => toggleDistractionFreeModeAction()}
+ style={mobileButtonStyle}
>
{this.renderTooltip(buttonId, labelText)}
<FontAwesomeIcon icon={['far', 'eye']} size={faSize} />
@@ -369,13 +416,26 @@ class toolbarContainer extends Component {
const mapStateToProps = (state) => {
const {
- animation, sidebar, browser, notifications, palettes, compare, map, measure, modal, modalAbout, ui, locationSearch, events, proj,
+ animation,
+ compare,
+ events,
+ locationSearch,
+ map,
+ measure,
+ modal,
+ modalAbout,
+ notifications,
+ palettes,
+ proj,
+ screenSize,
+ sidebar,
+ ui,
} = state;
const { isDistractionFreeModeActive } = ui;
const { number, type } = notifications;
const { activeString } = compare;
const activeLayersForProj = getAllActiveLayers(state);
- const isMobile = browser.lessThan.medium;
+ const isMobile = screenSize.isMobileDevice;
const faSize = isMobile ? '2x' : '1x';
const isCompareActive = compare.active;
const isLocationSearchExpanded = locationSearch.isExpanded;
diff --git a/web/js/containers/tour.js b/web/js/containers/tour.js
index 3521d389e..06fd8c7b3 100644
--- a/web/js/containers/tour.js
+++ b/web/js/containers/tour.js
@@ -516,9 +516,9 @@ const mapDispatchToProps = (dispatch) => ({
const mapStateToProps = (state) => {
const {
- browser, config, tour, palettes, models, compare, map,
+ screenSize, config, tour, palettes, models, compare, map,
} = state;
- const { screenWidth, screenHeight } = browser;
+ const { screenWidth, screenHeight } = screenSize;
return {
config,
diff --git a/web/js/main.js b/web/js/main.js
index 081941029..3e36e2498 100644
--- a/web/js/main.js
+++ b/web/js/main.js
@@ -12,7 +12,6 @@ import {
compose as defaultCompose,
} from 'redux';
import { composeWithDevTools } from '@redux-devtools/extension';
-import { calculateResponsiveState, responsiveStoreEnhancer } from 'redux-responsive';
import {
createReduxLocationActions,
listenForHistoryChange,
@@ -100,7 +99,6 @@ function render (config, legacyState) {
getInitialState(models, config, parameters),
compose(
applyMiddleware(...middleware),
- responsiveStoreEnhancer,
),
);
listenForHistoryChange(store, history);
@@ -136,8 +134,8 @@ window.onload = () => {
parameters.mockTour = isMockTour;
}
- const crs = calculateResponsiveState(window);
- config.initialIsMobile = crs.innerWidth <= 768;
+ const crs = window.innerWidth;
+ config.initialIsMobile = crs <= 768;
config.pageLoadTime = parameters.now
? util.parseDateUTC(parameters.now) || util.now()
diff --git a/web/js/map/natural-events/event-markers.js b/web/js/map/natural-events/event-markers.js
index 750b7467c..398302ba4 100644
--- a/web/js/map/natural-events/event-markers.js
+++ b/web/js/map/natural-events/event-markers.js
@@ -258,7 +258,7 @@ const createBoundingBox = function(coordinates, title, proj = 'EPSG:4326') {
const mapStateToProps = (state) => {
const {
- map, proj, events, requestedEvents, sidebar, date, browser,
+ map, proj, events, requestedEvents, sidebar, date, screenSize,
} = state;
return {
@@ -268,7 +268,7 @@ const mapStateToProps = (state) => {
proj,
selectedEvent: events.selected,
selectedDate: date.selected,
- isMobile: browser.lessThan.medium,
+ isMobile: screenSize.isMobileDevice,
isAnimatingToEvent: events.isAnimatingToEvent,
eventsData: getFilteredEvents(state),
eventsDataIsLoading: requestedEvents.isLoading,
diff --git a/web/js/map/ui.js b/web/js/map/ui.js
index a83bc53e9..c90b12a6f 100644
--- a/web/js/map/ui.js
+++ b/web/js/map/ui.js
@@ -26,9 +26,9 @@ import OlInteractionMouseWheelZoom from 'ol/interaction/MouseWheelZoom';
import OlInteractionDragZoom from 'ol/interaction/DragZoom';
import OlLayerGroup from 'ol/layer/Group';
import * as olProj from 'ol/proj';
-import { CALCULATE_RESPONSIVE_STATE } from 'redux-responsive';
import Cache from 'cachai';
import PQueue from 'p-queue/dist';
+import { SET_SCREEN_INFO } from '../modules/screen-size/constants';
import mapLayerBuilder from './layerbuilder';
import MapRunningData from './runningdata';
import { fly, saveRotation } from './util';
@@ -210,7 +210,7 @@ export default function mapui(models, config, store) {
case vectorStyleConstants.SET_FILTER_RANGE:
case vectorStyleConstants.SET_VECTORSTYLE:
case vectorStyleConstants.CLEAR_VECTORSTYLE:
- case CALCULATE_RESPONSIVE_STATE:
+ case SET_SCREEN_INFO:
return onResize();
case vectorStyleConstants.SET_SELECTED_VECTORS: {
const type = 'selection';
@@ -402,7 +402,7 @@ export default function mapui(models, config, store) {
*/
const addMarkerAndUpdateStore = (showDialog, geocodeResults, shouldFlyToCoordinates, coordinatesObject) => {
const state = store.getState();
- const { proj, browser } = state;
+ const { proj, screenSize } = state;
const results = geocodeResults;
if (!results) return;
@@ -412,7 +412,7 @@ export default function mapui(models, config, store) {
coordinatesObject,
results,
remove,
- browser.lessThan.medium,
+ screenSize.isMobileDevice,
showDialog,
);
@@ -531,8 +531,8 @@ export default function mapui(models, config, store) {
*/
function onResize() {
const state = store.getState();
- const { browser } = state;
- const isMobile = browser.lessThan.medium;
+ const { screenSize } = state;
+ const isMobile = screenSize.isMobileDevice;
const map = self.selected;
if (isMobile) {
@@ -1102,6 +1102,7 @@ export default function mapui(models, config, store) {
mapEl.style.display = 'none';
mapContainerEl.insertAdjacentElement('afterbegin', mapEl);
+
// Create two specific controls
const scaleMetric = new OlControlScaleLine({
className: 'wv-map-scale-metric',
@@ -1247,10 +1248,10 @@ export default function mapui(models, config, store) {
const throttledOnMouseMove = lodashThrottle(({ pixel }) => {
const state = store.getState();
const {
- events, browser, locationSearch, sidebar, animation, measure,
+ events, locationSearch, sidebar, animation, measure, screenSize,
} = state;
const { isCoordinateSearchActive } = locationSearch;
- const isMobile = browser.lessThan.medium;
+ const isMobile = screenSize.isMobileDevice;
const coords = map.getCoordinateFromPixel(pixel);
const isEventsTabActive = typeof events !== 'undefined' && events.active;
const isMapAnimating = animation.isPlaying;
diff --git a/web/js/modules/combine-reducers.js b/web/js/modules/combine-reducers.js
index 17afb0c03..551992d9a 100644
--- a/web/js/modules/combine-reducers.js
+++ b/web/js/modules/combine-reducers.js
@@ -1,5 +1,4 @@
import { combineReducers } from 'redux';
-import { createResponsiveStateReducer } from 'redux-responsive';
import { assign as lodashAssign } from 'lodash';
import { modalReducer, modalAboutReducer } from './modal/reducers';
import feedbackReducer from './feedback/reducers';
@@ -49,25 +48,14 @@ import uiReducers from './ui/reducers';
import { alertReducer } from './alerts/reducer';
import { smartHandoffReducer, getInitialState as getSmartHandoffInitialState } from './smart-handoff/reducer';
import { getInitialState as getInitialSettingsState, settingsReducer } from './settings/reducer';
+import { getInitialState as getInitialScreenSizeState, screenSizeReducer } from './screen-size/reducer';
import { loadingReducer } from './loading/reducers';
function lastAction(state = null, action) {
return action;
}
-/**
- * Access to page size so various resize listeners are
- * no longer necessary
- */
-const responsiveStateReducer = createResponsiveStateReducer(
- null,
- {
- extraFields: () => ({
- screenWidth: window.innerWidth,
- screenHeight: window.innerHeight,
- }),
- },
-);
+
/**
* Get initial module states based on config
* and parameters
@@ -86,6 +74,7 @@ export function getInitialState(models, config, parameters) {
layers: getLayersInitialState(config),
events: getInitialEventsState(config),
settings: getInitialSettingsState(),
+ screenSize: getInitialScreenSizeState(),
requestedEvents: eventRequestResponse(),
requestedEventSources: eventRequestResponse(),
smartHandoffs: getSmartHandoffInitialState(config),
@@ -104,7 +93,6 @@ const defaultReducer = (state = {}) => state;
const reducers = {
alerts: alertReducer,
animation: animationReducer,
- browser: responsiveStateReducer,
config: defaultReducer,
compare: compareReducer,
date: dateReducer,
@@ -130,6 +118,7 @@ const reducers = {
proj: projectionReducer,
requestedEvents,
requestedEventSources,
+ screenSize: screenSizeReducer,
settings: settingsReducer,
shortLink,
sidebar: sidebarReducer,
diff --git a/web/js/modules/location-search/util.js b/web/js/modules/location-search/util.js
index 7d975c2af..27ce6e345 100644
--- a/web/js/modules/location-search/util.js
+++ b/web/js/modules/location-search/util.js
@@ -128,7 +128,7 @@ export function mapLocationToLocationSearchState(
return validatedCoordinates;
});
- const isMobile = state.browser.lessThan.medium;
+ const isMobile = state.screenSize.isMobileDevice;
const localStorageCollapseState = getLocalStorageCollapseState();
const isExpanded = !isMobile && !localStorageCollapseState;
diff --git a/web/js/modules/screen-size/actions.js b/web/js/modules/screen-size/actions.js
new file mode 100644
index 000000000..4521674ed
--- /dev/null
+++ b/web/js/modules/screen-size/actions.js
@@ -0,0 +1,19 @@
+import { isMobileOnly, isTablet } from 'react-device-detect';
+import {
+ SET_SCREEN_INFO,
+} from './constants';
+
+export default function setScreenInfo() {
+ const screenHeight = window.innerHeight;
+ const screenWidth = window.innerWidth;
+ const isMobileDevice = screenWidth < 768 || isMobileOnly || isTablet;
+ const orientation = screenHeight > screenWidth ? 'portrait' : 'landscape';
+
+ return {
+ type: SET_SCREEN_INFO,
+ screenHeight,
+ screenWidth,
+ isMobileDevice,
+ orientation,
+ };
+}
diff --git a/web/js/modules/screen-size/constants.js b/web/js/modules/screen-size/constants.js
new file mode 100644
index 000000000..d4a043ff6
--- /dev/null
+++ b/web/js/modules/screen-size/constants.js
@@ -0,0 +1,2 @@
+// eslint-disable-next-line import/prefer-default-export
+export const SET_SCREEN_INFO = 'SCREEN_SIZE/SET_SCREEN_INFO';
diff --git a/web/js/modules/screen-size/reducer.js b/web/js/modules/screen-size/reducer.js
new file mode 100644
index 000000000..2005943b0
--- /dev/null
+++ b/web/js/modules/screen-size/reducer.js
@@ -0,0 +1,33 @@
+import { SET_SCREEN_INFO } from './constants';
+
+export const initialState = {
+ screenHeight: '',
+ screenWidth: '',
+ isMobileDevice: false,
+ orientation: '',
+ breakpoints: {},
+};
+
+export const getInitialState = () => ({
+ breakpoints: {
+ extraSmall: 480,
+ small: 768,
+ medium: 992,
+ large: 1200,
+ },
+});
+
+export const screenSizeReducer = (state = initialState, action) => {
+ switch (action.type) {
+ case SET_SCREEN_INFO:
+ return {
+ ...state,
+ screenHeight: action.screenHeight,
+ screenWidth: action.screenWidth,
+ isMobileDevice: action.isMobileDevice,
+ orientation: action.orientation,
+ };
+ default:
+ return state;
+ }
+};
diff --git a/web/js/modules/screen-size/util.js b/web/js/modules/screen-size/util.js
new file mode 100644
index 000000000..e69de29bb
diff --git a/web/js/modules/sidebar/actions.js b/web/js/modules/sidebar/actions.js
index a2103b8ec..eca13281d 100644
--- a/web/js/modules/sidebar/actions.js
+++ b/web/js/modules/sidebar/actions.js
@@ -20,7 +20,7 @@ export function changeTab(str) {
}
export function toggleSidebarCollapse() {
return (dispatch, getState) => {
- const isMobile = getState().browser.lessThan.medium;
+ const isMobile = getState().screenSize.isMobileDevice;
if (isMobile) {
dispatch({ type: TOGGLE_MOBILE_COLLAPSE });
} else {
@@ -31,7 +31,7 @@ export function toggleSidebarCollapse() {
export function collapseSidebar() {
return (dispatch, getState) => {
- const isMobile = getState().browser.lessThan.medium;
+ const isMobile = getState().screenSize.isMobileDevice;
if (isMobile) {
dispatch({ type: MOBILE_COLLAPSE_SIDEBAR });
} else {
@@ -42,7 +42,7 @@ export function collapseSidebar() {
export function expandSidebar() {
return (dispatch, getState) => {
- const isMobile = getState().browser.lessThan.medium;
+ const isMobile = getState().screenSize.isMobileDevice;
if (isMobile) {
dispatch({ type: MOBILE_EXPAND_SIDEBAR });
} else {
diff --git a/web/js/modules/vector-styles/util.js b/web/js/modules/vector-styles/util.js
index 29b62ee99..c6cee8530 100644
--- a/web/js/modules/vector-styles/util.js
+++ b/web/js/modules/vector-styles/util.js
@@ -293,8 +293,8 @@ function getModalContentsAtPixel(mapProps, config, compareState, isMobile) {
*/
export function onMapClickGetVectorFeatures(pixels, map, state, swipeOffset) {
const { config, compare } = state;
- const { screenWidth, screenHeight, lessThan } = state.browser;
- const isMobile = lessThan.medium;
+ const { screenWidth, screenHeight, isMobileDevice } = state.screenSize;
+ const isMobile = isMobileDevice;
const x = pixels[0];
const y = pixels[1];
const modalOffsetProps = {
diff --git a/web/scss/components/facets.scss b/web/scss/components/facets.scss
index 7d5d1c9ea..21dd6dd69 100644
--- a/web/scss/components/facets.scss
+++ b/web/scss/components/facets.scss
@@ -95,44 +95,53 @@
}
}
-@media (max-width: $mobile-max-width) {
- .facet-container {
- max-width: 100%;
- display: flex;
- flex-direction: column;
+.facet-container-mobile {
+ max-width: 100%;
+ display: flex;
+ flex-direction: column;
- & .filter-chip {
- font-size: 16px;
- padding: 6px 24px 6px 8px;
+ & .filter-chip {
+ font-size: 16px;
+ padding: 6px 24px 6px 8px;
- & .svg-inline--fa {
- right: 3px;
- top: 5px;
- }
+ & .svg-inline--fa {
+ right: 3px;
+ top: 5px;
}
+ }
- & .inner-container {
- margin-right: 2px;
- padding: 10px 14px;
- }
+ & .inner-container {
+ margin-right: 2px;
+ padding: 10px 14px;
+ }
- & .bag-o-chips {
- margin-right: 2px;
+ & .bag-o-chips {
+ margin-right: 2px;
+ }
+
+ & .facet-wrapper {
+ margin-bottom: 16px;
+
+ & .facet-tooltip {
+ top: 4px;
+ height: 20px;
+ width: 18px;
}
- & .facet-wrapper {
- margin-bottom: 16px;
+ & .facet-collapse-toggle {
+ height: 34px;
+ width: 28px;
+ }
+ }
- & .facet-tooltip {
- top: 4px;
- height: 20px;
- width: 18px;
- }
+ @media (orientation: landscape) {
+ .facet-tooltip {
+ top: -4px !important;
+ left: -5px !important;
+ }
- & .facet-collapse-toggle {
- height: 34px;
- width: 28px;
- }
+ .facet-collapse-toggle {
+ top: -10px !important;
}
}
diff --git a/web/scss/features/context-menu.scss b/web/scss/features/context-menu.scss
index 5614ec45e..af818acb2 100644
--- a/web/scss/features/context-menu.scss
+++ b/web/scss/features/context-menu.scss
@@ -11,6 +11,11 @@
transition: opacity 250ms ease !important;
}
+.react-contextmenu-mobile {
+ font-size: 14px !important;
+ padding: 0.75rem 1.25rem !important;
+}
+
.react-contextmenu.react-contextmenu--visible {
opacity: 1;
pointer-events: auto;
diff --git a/web/scss/features/event-filter.scss b/web/scss/features/event-filter.scss
index 1fd2bbab5..ac8c4ad3a 100644
--- a/web/scss/features/event-filter.scss
+++ b/web/scss/features/event-filter.scss
@@ -42,6 +42,30 @@
width: 315px;
}
+.event-filter-modal-mobile {
+ width: 100%;
+ max-width: 100%;
+ height: 100%;
+ margin: 0;
+
+ .modal-body {
+ padding: 5px 1rem;
+ }
+
+ .modal-content {
+ height: 100%;
+ }
+
+ .modal-body .category-toggles {
+ margin-top: 0;
+ margin-bottom: 0;
+ }
+
+ .modal-body .wv-checkbox {
+ margin-top: 5px;
+ }
+}
+
.events-filter {
.event-filter-date-range {
height: 50px;
diff --git a/web/scss/features/layers.scss b/web/scss/features/layers.scss
index a6b291fe9..36a429abc 100644
--- a/web/scss/features/layers.scss
+++ b/web/scss/features/layers.scss
@@ -721,7 +721,7 @@
}
}
-@media (min-width: $desktop-min-width) {
+@media (min-width: $tablet-min-width) {
.search-layers-container {
& div.layer-list-detail-container {
flex-direction: row;
@@ -729,6 +729,8 @@
}
.layer-detail-container {
+ height: 100% important;
+
&.browse .layers-all-layer {
padding: 10px 15px;
}
@@ -758,52 +760,42 @@
.layer-detail-container.search {
flex: 2;
- height: 65%;
border-top: 2px solid #d54e21;
padding: 4px 0 0 2px;
background-image: linear-gradient(#ccc, #eee 8%);
}
}
-@media (min-width: $tablet-min-width) {
- .category-width .layer-modal-content {
- height: calc(var(--vh, 1vh) * 100 - 135px);
- }
-
- .browse-search-width .layer-modal-content {
- height: calc(var(--vh, 1vh) * 100 - 155px);
- }
-
- .browse-search-width .search-layers-container {
- height: calc(var(--vh, 1vh) * 100 - 157px);
- }
+.custom-layer-dialog-mobile {
+ width: 100% !important;
+ max-width: 100% !important;
+ margin: 0 !important;
+ height: 100%;
- .browse-search-width .search-layers-container.browse {
- height: calc(var(--vh, 1vh) * 100 - 195px);
+ & .modal-body {
+ padding: 0 0 0 8px;
}
- .browse-search-width .search-layers-container.recent-layers {
- height: calc(var(--vh, 1vh) * 100 - 235px);
+ &.browse-search-width {
+ width: 95%;
+ max-width: 800px;
}
-}
-/* Mobile Styles Begin Here */
-@media (max-width: $mobile-max-width) {
.category-width .layer-modal-content {
padding: 0;
height: calc(var(--vh, 1vh) * 100 - 40px);
}
- .browse-search-width .layer-modal-content {
+ .layer-modal-content {
padding: 0;
height: calc(var(--vh, 1vh) * 100 - 70px);
}
- .browse-search-width .search-layers-container.browse {
+ .search-layers-container.browse {
height: calc(var(--vh, 1vh) * 100 - 122px);
}
- .browse-search-width .search-layers-container.recent-layers {
+ .search-layers-container.recent-layers {
height: calc(var(--vh, 1vh) * 100 - 95px);
}
@@ -884,9 +876,10 @@
}
.layer-detail-container.search {
- border-top: 5px solid #d54e21;
- padding-left: 2px;
- background-image: linear-gradient(#aaa, #ddd 15%);
+ flex: 1;
+ border-top: 2px solid #d54e21;
+ padding: 4px 0 0 2px;
+ background-image: linear-gradient(#ccc, #eee 8%);
}
}
diff --git a/web/scss/features/location-search.scss b/web/scss/features/location-search.scss
index aee20deb7..55d25eb09 100644
--- a/web/scss/features/location-search.scss
+++ b/web/scss/features/location-search.scss
@@ -180,10 +180,10 @@
/* Mobile Styling */
@media only screen and (max-width: $mobile-max-width) {
- .location-search-expanded {
- position: static;
- width: 100%;
- }
+ // .location-search-expanded {
+ // position: static;
+ // width: 100%;
+ // }
.location-search-input-container {
width: 100%;
diff --git a/web/scss/features/measure.scss b/web/scss/features/measure.scss
index f07818654..d7b68c515 100644
--- a/web/scss/features/measure.scss
+++ b/web/scss/features/measure.scss
@@ -39,15 +39,9 @@
}
}
-@media (max-width: $mobile-max-width) {
- .wv-measure-button {
- bottom: 20px;
- }
-
- .modal-dialog.measure-tool-modal {
- bottom: 60px;
- margin: 0;
- }
+.modal-dialog.measure-tool-modal.measure-mobile {
+ bottom: 60px;
+ margin: 0;
}
.measure-unit-toggle {
diff --git a/web/scss/features/sidebar-panel.scss b/web/scss/features/sidebar-panel.scss
index a462da8a0..a98d2d5c0 100644
--- a/web/scss/features/sidebar-panel.scss
+++ b/web/scss/features/sidebar-panel.scss
@@ -91,17 +91,6 @@
color: #333;
}
}
-
- @media (max-width: $mobile-max-width) {
- height: 48px;
- width: 45px;
-
- svg.collapse-icon {
- height: 40px;
- width: 40px;
- color: #fff;
- }
- }
}
.sidebar-panel {
@@ -539,8 +528,15 @@ li.item.productsitem.inmotion,
background: linear-gradient(90deg, rgb(204 204 204 / 0%) 0%, rgb(204 204 204 / 100%) 30%);
width: 100px;
+ & .layer-group-more-options {
+ top: 10px;
+ position: absolute;
+ right: 0;
+ }
+
& .button {
cursor: pointer;
+ vertical-align: bottom;
}
}
}
diff --git a/web/scss/features/sidebar.scss b/web/scss/features/sidebar.scss
index 258023a9d..d036a9b52 100644
--- a/web/scss/features/sidebar.scss
+++ b/web/scss/features/sidebar.scss
@@ -118,21 +118,21 @@
}
}
-#wv-logo {
- background: url("../brand/images/wv-logo.svg?v=@BUILD_NONCE@") no-repeat center $wv-transparent-black;
- display: block;
- width: 286px;
- height: 55px;
- padding: 5px 0;
- position: absolute;
- top: 10px;
- left: 10px;
- border: 1px solid #333;
- border-bottom: 1px solid transparent;
- border-top-right-radius: 5px;
- border-top-left-radius: 5px;
- box-sizing: border-box;
-}
+// #wv-logo {
+// background: url("../brand/images/wv-logo.svg?v=@BUILD_NONCE@") no-repeat center $wv-transparent-black;
+// display: block;
+// width: 286px;
+// height: 55px;
+// padding: 5px 0;
+// position: absolute;
+// top: 10px;
+// left: 10px;
+// border: 1px solid #333;
+// border-bottom: 1px solid transparent;
+// border-top-right-radius: 5px;
+// border-top-left-radius: 5px;
+// box-sizing: border-box;
+// }
.wv-logo-distraction-free-mode {
border-radius: 5px;
diff --git a/web/scss/features/toolbar.scss b/web/scss/features/toolbar.scss
index a1ce48a06..76aa8077f 100644
--- a/web/scss/features/toolbar.scss
+++ b/web/scss/features/toolbar.scss
@@ -54,7 +54,7 @@
.toolbar-list-modal.modal-dialog {
width: 160px;
- @media (max-width: $mobile-max-width) {
+ @media (max-width: 1200px) {
width: 180px;
}
}
diff --git a/web/scss/mobile.scss b/web/scss/mobile.scss
index d66360b16..b55d9c0ad 100644
--- a/web/scss/mobile.scss
+++ b/web/scss/mobile.scss
@@ -16,35 +16,8 @@
display: none !important;
}
- .wv-coords-map,
- .wv-coords-container {
- display: none !important;
- }
-
/* EMBED MODE */
#wv-content:not(.embed-mode) {
- #wv-sidebar {
- position: static;
- }
-
- #products-holder {
- display: block;
- float: left;
- left: 0;
- min-width: 238px;
- width: 100%;
- height: 100%;
- position: absolute !important;
- overflow: hidden;
- background: rgb(38 43 49);
- top: 0;
- z-index: 1000;
- }
-
- .sidebar-panel {
- height: 96%;
- }
-
#selectorboxcontent {
max-height: 97%;
}
@@ -59,33 +32,12 @@
display: none;
}
- #wv-logo {
- background: url("../brand/images/wv-logo-mobile.svg?v=@BUILD_NONCE@") no-repeat center $wv-transparent-black;
- display: block;
- height: 42px;
- width: 56px;
- padding: 5px;
- border-radius: 5px;
- border: 1px solid #333;
- }
-
#wv-toolbar li {
display: block;
float: left;
margin: 1px;
}
- #wv-image-button {
- display: none;
- }
-
- .wv-toolbar-button {
- font-size: 14.3px;
- height: 44px;
- margin: 0 0 0 4px;
- padding: 5.72px 9.1px;
- }
-
button#layers-add,
button#compare-toggle-button {
width: 100%;