Interactive interface for browsing global, full-resolution satellite imagery
give alerts their own container so multple can fit on screen in a stacked orientation instead of overlapping
Jason Kente1a500c2f0c4
diff --git a/web/css/alert.css b/web/css/alert.cssindex 62a4c603b..23a1e9429 100644--- a/web/css/alert.css+++ b/web/css/alert.css@@ -1,3 +1,9 @@+.wv-alert-container {+ position: absolute;+ top: 60px !important;+ right: 10px !important;+ left: auto !important;+}.wv-alert {display: flex;align-items: center;@@ -7,6 +13,7 @@padding: 0;border: none;z-index: 100;+ margin-bottom: 5px;}.wv-alert .close-alert {padding: 11px 2px;diff --git a/web/css/events.css b/web/css/events.cssindex b520ab871..3f2a805db 100644--- a/web/css/events.css+++ b/web/css/events.css@@ -315,10 +315,7 @@.wv-alert,.notify-alert {- position: absolute;- top: 60px !important;- right: 10px !important;- left: auto !important;+ position: relative;color: #fff;background: #282828;border: #282828;diff --git a/web/css/map.css b/web/css/map.cssindex 6a08b71ca..efe0b180d 100644--- a/web/css/map.css+++ b/web/css/map.css@@ -26,7 +26,7 @@}.wv-map-zoom i {- padding: 17px 14px;+ padding: 15px 14px;display: block;line-height: normal;}@@ -38,13 +38,13 @@}.wv-map-zoom-in {- top: 135px;+ top: 150px;border-top-left-radius: 10px;border-top-right-radius: 10px;}.wv-map-zoom-out {- top: 180px;+ top: 195px;border-bottom-left-radius: 10px;border-bottom-right-radius: 10px;}@@ -56,7 +56,7 @@}.wv-map-rotate-left {- top: 247px;+ top: 251px;border-top-left-radius: 10px;border-top-right-radius: 10px;}diff --git a/web/index.html b/web/index.htmlindex 7f173d571..baf7729ac 100644--- a/web/index.html+++ b/web/index.html@@ -49,8 +49,6 @@ Licensed under the NASA Open Source Agreement, Version 1.3 (http://opensource.gs<body><div data-role="page" id="app"></div>- <div id="wv-tour" class="wv-tour"></div>- <div id="wv-alerts" class="wv-alerts"></div><div id="wv-vector-metadata" class="wv-vector-metadata"></div><div class="backdrop"></div></body>diff --git a/web/js/app.js b/web/js/app.jsindex b467238e2..684ad5104 100644--- a/web/js/app.js+++ b/web/js/app.js@@ -105,7 +105,9 @@ class App extends React.Component {return (<div className="wv-content" id="wv-content" data-role="content"><Toolbar />- <FeatureAlert />+ <div id="wv-alert-container" className="wv-alert-container">+ <FeatureAlert />+ </div><Sidebar />{isTourActive ? <Tour /> : null}<div id="layer-modal" className="layer-modal" />diff --git a/web/js/components/feature-alert/alert.js b/web/js/components/feature-alert/alert.jsindex 3f7f8b0b3..789de9a36 100644--- a/web/js/components/feature-alert/alert.js+++ b/web/js/components/feature-alert/alert.js@@ -35,6 +35,7 @@ class FeaturedAlert extends React.Component {onClick={this.props.showModal.bind(this)}onDismiss={this.dismissAlert.bind(this)}message="Check out our new geostationary layers!"+ noPortal={true}/>);}diff --git a/web/js/components/util/alert.js b/web/js/components/util/alert.jsindex 802b48de5..e458287b3 100644--- a/web/js/components/util/alert.js+++ b/web/js/components/util/alert.js@@ -29,7 +29,7 @@ export default class AlertComponent extends React.Component {}}- render() {+ renderAlert() {const {title,message,@@ -39,34 +39,44 @@ export default class AlertComponent extends React.Component {onClick} = this.props;return (- <Portal node={document && document.getElementById('wv-content')}>- <Alert- id={this.props.id}- className="wv-alert"- isOpen={isOpen}+ <Alert+ id={this.props.id}+ className="wv-alert"+ isOpen={isOpen}+ >+ <div+ className="alert-content"+ title={title}+ onClick={onClick}>- <div- className="alert-content"- title={title}- onClick={onClick}- >- {iconClassName && (- <i className={'wv-alert-icon ' + iconClassName} />- )}- <div className="wv-alert-message">- {message}- </div>- </div>- {onDismiss && (- <div id={`${this.props.id}-close`} className="close-alert" onClick={onDismiss}>- <i className="fa fa-times exit fa-1x" />- </div>+ {iconClassName && (+ <i className={'wv-alert-icon ' + iconClassName} />)}- </Alert>- </Portal>+ <div className="wv-alert-message">+ {message}+ </div>+ </div>+ {onDismiss && (+ <div id={`${this.props.id}-close`} className="close-alert" onClick={onDismiss}>+ <i className="fa fa-times exit fa-1x" />+ </div>+ )}+ </Alert>);}++ render() {+ console.log(this.props.noPortal);+ return this.props.noPortal+ ? (this.renderAlert())+ : (+ <Portal node={document && document.getElementById('wv-alert-container')}>+ {this.renderAlert()}+ </Portal>+ );+ }}+AlertComponent.defaultProps = {iconClassName: 'fas fa-exclamation-triangle fa-1x',title: ''@@ -76,6 +86,7 @@ AlertComponent.propTypes = {id: PropTypes.string,isOpen: PropTypes.bool,message: PropTypes.string,+ noPortal: PropTypes.bool,onClick: PropTypes.func,onDismiss: PropTypes.func,timeout: PropTypes.number,