Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

WV-2290: Changing Location of Loading Spinner on Mobile (#3943)

Ryan Weiler13828edbfd32
diff --git a/web/js/components/map/loading-spinner.js b/web/js/components/map/loading-spinner.js
index f0230d81e..dcea43459 100644
--- a/web/js/components/map/loading-spinner.js
+++ b/web/js/components/map/loading-spinner.js
@@ -3,7 +3,7 @@ import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { Spinner } from 'reactstrap';
-function LoadingIndicator({ msg, isLoading }) {
+function LoadingIndicator({ msg, isLoading, isMobile }) {
const spinnerStyle = {
position: 'absolute',
top: 10,
@@ -11,24 +11,33 @@ function LoadingIndicator({ msg, isLoading }) {
zIndex: 999,
};
+ const mobileSpinnerStyle = {
+ position: 'absolute',
+ top: 10,
+ left: 80,
+ zIndex: 999,
+ };
+
return isLoading && (
- <div style={spinnerStyle}>
+ <div style={isMobile ? mobileSpinnerStyle : spinnerStyle}>
<Spinner color="light" size="sm" />
{msg}
</div>
);
}
-
LoadingIndicator.propTypes = {
msg: PropTypes.string,
isLoading: PropTypes.bool,
+ isMobile: PropTypes.bool,
};
const mapStateToProps = (state) => {
- const { msg, isLoading } = state.loading;
+ const { browser, loading } = state;
+ const { msg, isLoading } = loading;
return {
- msg,
isLoading,
+ isMobile: browser.lessThan.medium,
+ msg,
};
};
export default connect(mapStateToProps)(LoadingIndicator);