Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

flexify inner components of alert notification and add mobile friendly styling

Edward Platobbcea85f71bf
diff --git a/web/css/alert.css b/web/css/alert.css
index eecd2bf19..f136f3c68 100644
--- a/web/css/alert.css
+++ b/web/css/alert.css
@@ -8,15 +8,10 @@
border: none;
z-index: 100;
}
-.wv-alert div {
- display: inline-block;
- padding: 11px;
- &.close-alert {
- padding: 11px 2px;
- }
+.wv-alert .close-alert {
+ padding: 11px 2px;
}
.wv-alert div:hover {
- display: inline-block;
background-color: #ddd;
color: #333;
}
@@ -33,3 +28,27 @@
.wv-alert div:hover .exit {
color: #333;
}
+.wv-alert-icon {
+ padding-left: 3px;
+ margin-left: 5px;
+}
+.alert-content {
+ display: flex;
+ align-items: center;
+ min-height: 40px;
+}
+.wv-alert-message {
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: space-between;
+}
+.wv-alert-read-more {
+ min-width: 100px;
+ text-align: right;
+}
+@media screen and (max-device-width: 420px) {
+ .wv-alert-read-more {
+ min-width: 0;
+ text-align: left;
+ }
+}
diff --git a/web/css/events.css b/web/css/events.css
index bec9b3e1d..ab387c3b4 100644
--- a/web/css/events.css
+++ b/web/css/events.css
@@ -349,6 +349,13 @@
}
}
+@media only screen and (max-device-width: 420px) {
+ .wv-alert,
+ .notify-alert {
+ left: 10px !important;
+ }
+}
+
.notify-alert i {
font-size: 1.4em;
-webkit-box-sizing: border-box;
diff --git a/web/js/components/util/alert.js b/web/js/components/util/alert.js
index adfc1012b..0da4a0de2 100644
--- a/web/js/components/util/alert.js
+++ b/web/js/components/util/alert.js
@@ -30,28 +30,36 @@ export default class AlertComponent extends React.Component {
}
render() {
+ const {
+ title,
+ message,
+ iconClassName,
+ isOpen,
+ onDismiss,
+ onClick
+ } = this.props;
return (
<Portal node={document && document.getElementById('wv-content')}>
- <Alert className="wv-alert" isOpen={this.props.isOpen}>
+ <Alert className="wv-alert" isOpen={isOpen}>
<div
className="alert-content"
- title={this.props.title}
- onClick={this.props.onClick}
+ title={title}
+ onClick={onClick}
>
- <span>
- {this.props.iconClassName && (
- <i className={this.props.iconClassName} />
+ {iconClassName && (
+ <i className={'wv-alert-icon ' + iconClassName} />
+ )}
+ <div className="wv-alert-message">
+ <div>
+ {message}
+ </div>
+ {onClick && (
+ <span className="wv-alert-read-more">Read More...</span>
)}
- {this.props.message}
- {this.props.onClick && (
- <span>
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Read More...
- </span>
- )}
- </span>
+ </div>
</div>
- {this.props.onDismiss && (
- <div className="close-alert" onClick={this.props.onDismiss}>
+ {onDismiss && (
+ <div className="close-alert" onClick={onDismiss}>
<i className="fa fa-times exit fa-1x" />
</div>
)}