Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

update styles for better separation

Jason Kent952ef7a72576
diff --git a/web/css/smart-handoff.css b/web/css/smart-handoff.css
index 57b7b59c3..c8fa513cb 100644
--- a/web/css/smart-handoff.css
+++ b/web/css/smart-handoff.css
@@ -52,13 +52,20 @@
margin-top: 15px;
display: block;
color: #fff;
- overflow-y: scroll;
+ overflow-y: auto;
min-height: 40px;
max-height: calc(var(--vh, 1vh) * 100 - 500px);
}
.smart-handoff-layer-list .layer-item {
- padding: 5px;
+ padding: 8px;
+ margin: 10px 0;
+ background: #404040;
+ border: 1px solid #333;
+ &.selected {
+ border: 1px solid #bbb;
+ background: #333;
+ }
.layer-title {
font-size: 14px;
line-height: 15px;
@@ -68,12 +75,11 @@
color: #999;
}
.collection-choice {
- margin: 4px 5px 8px 15px;
+ margin: 8px 5px 8px 15px;
input {
cursor: pointer;
- top: 2px;
position: relative;
- top: -2px;
+ top: 2px;
}
label {
color: #eee;
@@ -81,6 +87,9 @@
margin: 0 5px 0 7px;
font-size: 13px;
}
+ svg {
+ margin-left: 3px;
+ }
}
}
@@ -169,10 +178,10 @@ label[for='chk-crop-toggle'] span {
color: #fff;
}
.smart-handoff-message {
- line-height: 1.25em;
margin: 15px 0;
text-align: left;
- font-size: 17px;
+ font-size: 15px;
+ line-height: 16px;
color: #ddd;
}
.smart-handoff-about hr {
@@ -212,15 +221,40 @@ label[for='chk-crop-toggle'] span {
background: #343434;
color: #fff;
width: 100%;
- padding: 20px;
+ padding: 1px 20px 30px;
margin: 25px 0;
border-radius: 10px;
}
.smart-handoff-layer-info h1 {
font-size: 14px;
color: #fff;
- margin: 0;
- margin-bottom: 0.5em;
+ margin: 30px 0 8px;
+ text-transform: uppercase;
+ font-weight: 600;
+ text-align: left;
+ display: block;
+}
+
+.handoff-modal-layer-title {
+ font-size: 14px;
+ margin: 0 0 4px;
+ color: #fff;
+ text-align: left;
+}
+.handoff-modal-layer-subtitle {
+ text-align: left;
+ color: #ccc;
+ margin: 0 0 10px;
+}
+.handoff-modal-date {
+ font-family: monospace;
+ font-size: 16px;
+ text-align: left;
+}
+.handoff-modal-link {
+ text-align: left;
+ font-size: 14px;
+ line-height: 18px;
}
.toggle-more-info {
margin-top: 25px;
diff --git a/web/js/components/smart-handoffs/smart-handoff-modal.js b/web/js/components/smart-handoffs/smart-handoff-modal.js
index ba617cd8d..5fee132d6 100644
--- a/web/js/components/smart-handoffs/smart-handoff-modal.js
+++ b/web/js/components/smart-handoffs/smart-handoff-modal.js
@@ -5,6 +5,11 @@ import Button from '../util/button';
import Checkbox from '../util/checkbox';
import safeLocalStorage from '../../util/local-storage';
+const STD_NRT_MAP = {
+ STD: 'Standard',
+ NRT: 'Near Real-Time',
+};
+
/**
* The Smart-Handoff components replaces the existing data download capability
* by directing users to select specific layer products within Worldview and 'hand' them 'off'
@@ -16,8 +21,10 @@ function SmartHandoffModal({
}) {
// Hides Earthdata Search information by default
const [showMoreInfo, toggleInfo] = useState(false);
- const { title, subtitle } = selectedLayer;
- const cmrSearchDetailURL = `https://cmr.earthdata.nasa.gov/search/concepts/${selectedCollection.value}.html`;
+ const {
+ value, title, type, version,
+ } = selectedCollection;
+ const cmrSearchDetailURL = `https://cmr.earthdata.nasa.gov/search/concepts/${value}.html`;
return (
@@ -26,7 +33,6 @@ function SmartHandoffModal({
<div className="smart-handoff-heading">
<a href="https://search.earthdata.nasa.gov" target="_blank" rel="noopener noreferrer">
<img src="images/earth-data-search-logo.png" />
- <h1>search.earthdata.nasa.gov</h1>
</a>
</div>
@@ -77,29 +83,28 @@ function SmartHandoffModal({
<h2><span>{showMoreInfo ? 'Hide Info' : 'Show More Info'}</span></h2>
</div>
- <div className="smart-handoff-layer-info row">
- <div className="col">
- <h1> Selected Worldview layer: </h1>
- <p className="smart-handoff-layer-name">
- {title}
- </p>
- <p className="smart-handoff-layer-name">
- {subtitle}
- </p>
- </div>
+ <div className="smart-handoff-layer-info">
- <div className="col">
- <h1> Selected date:</h1>
- <p><span style={{ fontFamily: 'monospace' }}>{displayDate}</span></p>
- </div>
-
- <div className="col">
- <h1> Collection details: </h1>
+ <h1> Collection: </h1>
+ <div className="handoff-modal-link">
+ {`${STD_NRT_MAP[type]} - v${version}`}
+ <br />
<a href={cmrSearchDetailURL} target="_blank" rel="noopener noreferrer">
- <p>{`${selectedCollection.title}`}</p>
+ {`${title}`}
</a>
</div>
+ <h1> Layer: </h1>
+
+ <div className="handoff-modal-layer-title">
+ {selectedLayer.title}
+ </div>
+ <div className="handoff-modal-layer-subtitle">
+ {selectedLayer.subtitle}
+ </div>
+
+ <h1> Date:</h1>
+ <div className="handoff-modal-date">{displayDate}</div>
</div>
<div className="smart-handoff-button-group">
diff --git a/web/js/containers/sidebar/smart-handoff.js b/web/js/containers/sidebar/smart-handoff.js
index f8c79bfdf..6942ad427 100644
--- a/web/js/containers/sidebar/smart-handoff.js
+++ b/web/js/containers/sidebar/smart-handoff.js
@@ -299,13 +299,13 @@ class SmartHandoff extends Component {
this.setState(newState);
}
- renderCollectionTooltip = ({ value, title, type }) => {
+ renderCollectionTooltip = ({ value, title }, tooltipTarget) => {
const cmrSearchDetailURL = `https://cmr.earthdata.nasa.gov/search/concepts/${value}.html`;
return (
<UncontrolledTooltip
className="zot-tooltip"
boundariesElement="window"
- target={`${util.encodeId(value)}-tooltp`}
+ target={tooltipTarget}
placement="right"
trigger="hover"
autohide={false}
@@ -324,40 +324,52 @@ class SmartHandoff extends Component {
*/
renderLayerChoices() {
const { activeLayers } = this.props;
- const { selectedCollection, currentExtent } = this.state;
+ const { selectedCollection, selectedLayer, currentExtent } = this.state;
return (
<div className="smart-handoff-layer-list">
- {activeLayers.map((layer) => layer.conceptIds && (
- <div className="layer-item" key={`${util.encodeId(layer.id)}-layer-choice`}>
- <div className="layer-title">{layer.title}</div>
- <div className="layer-subtitle">{layer.subtitle}</div>
-
- {layer.conceptIds.map((collection) => {
- const {
- type, value, version,
- } = collection;
- const inputId = `${util.encodeId(value)}-collection-choice`;
-
- return (
- <div className="collection-choice" key={inputId}>
- <input
- id={inputId}
- type="radio"
- name="smart-handoff-layer-radio"
- checked={(selectedCollection || {}).value === value}
- onChange={() => this.onLayerChange(layer, collection, currentExtent)}
- />
- <label htmlFor={inputId}>{`${STD_NRT_MAP[type]} - v${version}`}</label>
- <FontAwesomeIcon id={`${util.encodeId(value)}-tooltp`} icon="info-circle" />
- {this.renderCollectionTooltip(collection)}
- </div>
- );
- })}
-
- </div>
- ))}
+ {activeLayers.map((layer) => {
+ if (!layer.conceptIds) return;
+
+ const layerIsSelected = (selectedLayer || {}).id === layer.id;
+ const itemClass = layerIsSelected ? 'layer-item selected' : 'layer-item';
+
+ return (
+ <div className={itemClass} key={`${util.encodeId(layer.id)}-layer-choice`}>
+ <div className="layer-title">{layer.title}</div>
+ <div className="layer-subtitle">{layer.subtitle}</div>
+
+ {layer.conceptIds.map((collection) => {
+ const {
+ type, value, version,
+ } = collection;
+ const inputId = `${util.encodeId(value)}-${util.encodeId(layer.id)}-collection-choice`;
+ const isSelected = (selectedCollection || {}).value === value && layerIsSelected;
+ const labelId = `${inputId}-label`;
+
+ return (
+ <div className="collection-choice" key={inputId}>
+ <input
+ id={inputId}
+ type="radio"
+ name="smart-handoff-layer-radio"
+ checked={isSelected}
+ onChange={() => this.onLayerChange(layer, collection, currentExtent)}
+ />
+ <label id={labelId} htmlFor={inputId}>
+ {`${STD_NRT_MAP[type]} - v${version}`}
+ <FontAwesomeIcon id={`${util.encodeId(value)}-tooltp`} icon="info-circle" />
+ </label>
+
+ {this.renderCollectionTooltip(collection, labelId)}
+ </div>
+ );
+ })}
+
+ </div>
+ );
+ })}
</div>
);
}
@@ -614,7 +626,7 @@ const mapDispatchToProps = (dispatch) => ({
selectedCollection,
continueToEDS,
},
- size: 'lg',
+ size: 'md',
}),
);
},