Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

use new alert components

Jason Kent985636456445
diff --git a/web/js/containers/alerts.js b/web/js/containers/alerts.js
index 54715a347..754b0ed2d 100644
--- a/web/js/containers/alerts.js
+++ b/web/js/containers/alerts.js
@@ -41,7 +41,7 @@ class DismissableAlerts extends React.Component {
if (isSmall || !HAS_LOCAL_STORAGE) return null;
return (
<>
- {!hasDismissedEvents && isEventsActive ? (
+ {!hasDismissedEvents && isEventsActive && (
<AlertUtil
id="event-alert"
isOpen
@@ -50,8 +50,8 @@ class DismissableAlerts extends React.Component {
onDismiss={() => this.dismissAlert(DISMISSED_EVENT_VIS_ALERT, 'hasDismissedEvents')}
message="Events may not be visible at all times."
/>
- ) : null}
- {!hasDismissedCompare && isCompareActive ? (
+ )}
+ {!hasDismissedCompare && isCompareActive && (
<AlertUtil
isOpen
noPortal
@@ -59,8 +59,8 @@ class DismissableAlerts extends React.Component {
onDismiss={() => this.dismissAlert(DISMISSED_COMPARE_ALERT, 'hasDismissedCompare')}
message="You are now in comparison mode."
/>
- ) : null}
- {isVectorAlertPresent ? (
+ )}
+ {isVectorAlertPresent && (
<AlertUtil
isOpen
noPortal
@@ -68,7 +68,7 @@ class DismissableAlerts extends React.Component {
onDismiss={dismissVectorAlert}
message="Vector features may not be clickable at all zoom levels."
/>
- ) : null}
+ )}
</>
);
}
diff --git a/web/js/containers/sidebar/events.js b/web/js/containers/sidebar/events.js
index 4aaf6ad8a..d6e32d7a9 100644
--- a/web/js/containers/sidebar/events.js
+++ b/web/js/containers/sidebar/events.js
@@ -18,6 +18,7 @@ import { collapseSidebar } from '../../modules/sidebar/actions';
import { selectDate } from '../../modules/date/actions';
import getSelectedDate from '../../modules/date/selectors';
import { getEventCategories } from '../../modules/natural-events/selectors';
+import AlertUtil from '../../components/util/alert';
function Events(props) {
const {
@@ -47,6 +48,7 @@ function Events(props) {
const ALL_CATEGORY = 'All Event Categories';
const [selectedCategory, selectCategory] = useState(ALL_CATEGORY);
+ const [showInactiveEventAlert, setInactiveEventAlert] = useState(selected.id && !selected.date);
const initRequests = () => {
let eventsRequestURL = `${apiURL}/events`;
@@ -154,6 +156,14 @@ function Events(props) {
</div>
</Scrollbars>
+ {showInactiveEventAlert && (
+ <AlertUtil
+ id="event-unavailable-alert"
+ isOpen
+ onDismiss={() => { setInactiveEventAlert(false); }}
+ message={`The event with an id of ${selected.id} is no longer active.`}
+ />
+ )}
</div>
);
}
diff --git a/web/js/map/natural-events/ui.js b/web/js/map/natural-events/ui.js
index 2c4b66cf5..a721f89de 100644
--- a/web/js/map/natural-events/ui.js
+++ b/web/js/map/natural-events/ui.js
@@ -247,7 +247,6 @@ export default function naturalEventsUI(ui, config, store, models) {
const category = event && event.categories[0].title;
const isSameCategory = category === prevCategory;
if (!event) {
- wvui.notify(`The event with an id of ${id} is no longer active.`);
return;
}
date = date || getDefaultEventDate(event);