Interactive interface for browsing global, full-resolution satellite imagery
layout cleanup
Jason Kent2ffcf22abb53
diff --git a/web/css/layers.css b/web/css/layers.cssindex 25c45298e..4537c45ca 100644--- a/web/css/layers.css+++ b/web/css/layers.css@@ -100,10 +100,10 @@/* Categories view */-/*.layer-modal-content .categories-nav {- margin-right: 13px;-} */+ margin: auto;+ max-width: 960px;+}.layer-modal-content .categories-nav .nav-item {height: 31px;@@ -409,6 +409,22 @@transform: translateY(-50%);}+.measurement-row {+ & .measure-row-contents {+ display: flex;+ flex-wrap: wrap;+ margin-top: 10px;+ padding-bottom: 5px;+ }+ & .source-tabs {+ width: 35%;+ }+ & .tab-content {+ width: 65%;+ padding: 0 5px;+ }+}+.measurement-row .source-nav-item {cursor: pointer;font-family: 'Open Sans', sans-serif;@@ -704,7 +720,6 @@}.custom-layer-dialog {- width: 1200px;max-width: 1200px;background-color: #e8e8e8;@@ -712,6 +727,11 @@width: 100%;padding: 0 11px 5px 0;}+ & .category-masonry-case {+ overflow: hidden;+ margin: auto;+ max-width: 960px;+ }& .modal-header {border-bottom: none;}@@ -722,9 +742,6 @@& .modal-title {width: 100%;}- & .category-masonry-case {- overflow: hidden;- }& .back-button {margin-right: 10px;}@@ -744,6 +761,12 @@@media (max-width: 1024px) {.custom-layer-dialog {width: 95%;+ & .category-masonry-case {+ max-width: 640px;+ }+ & .categories-nav {+ max-width: 640px;+ }}}diff --git a/web/js/components/layer/product-picker/category.js b/web/js/components/layer/product-picker/category-cell.jssimilarity index 97%rename from web/js/components/layer/product-picker/category.jsrename to web/js/components/layer/product-picker/category-cell.jsindex 9a22fb700..8c3eb92cb 100644--- a/web/js/components/layer/product-picker/category.js+++ b/web/js/components/layer/product-picker/category-cell.js@@ -6,7 +6,7 @@ import PropTypes from 'prop-types';* @class LayerList* @extends React.Component*/-class Category extends React.Component {+class CategoryCell extends React.Component {render() {const {category,@@ -114,7 +114,7 @@ var interestCssName = function(name) {return name;}};-Category.propTypes = {+CategoryCell.propTypes = {category: PropTypes.object,categoryType: PropTypes.string,drawMeasurements: PropTypes.func,@@ -122,4 +122,4 @@ Category.propTypes = {measurementConfig: PropTypes.object};-export default Category;+export default CategoryCell;diff --git a/web/js/components/layer/product-picker/category-list.js b/web/js/components/layer/product-picker/category-grid.jssimilarity index 87%rename from web/js/components/layer/product-picker/category-list.jsrename to web/js/components/layer/product-picker/category-grid.jsindex 13af5caf9..6a640aead 100644--- a/web/js/components/layer/product-picker/category-list.js+++ b/web/js/components/layer/product-picker/category-grid.js@@ -1,6 +1,6 @@import React from 'react';import PropTypes from 'prop-types';-import Category from './category';+import CategoryCell from './category-cell';import lodashOrderBy from 'lodash/orderBy';import Masonry from 'react-masonry-component';@@ -9,7 +9,7 @@ import Masonry from 'react-masonry-component';* @class LayerList* @extends React.Component*/-class CategoryList extends React.Component {+class CategoryGrid extends React.Component {render() {const {categories,@@ -21,7 +21,7 @@ class CategoryList extends React.Component {} = this.props;const masonryOptions = {transitionDuration: '0.6s',- columnWidth: width >= 630 ? 310 : width - 26,+ columnWidth: 310,gutter: 10};categories.map(item => {@@ -36,7 +36,7 @@ class CategoryList extends React.Component {return (<Masonry className="category-masonry-case" options={masonryOptions}>{orderedCategories.map(category => (- <Category+ <CategoryCellkey={category.id}category={category}categoryType={categoryType}@@ -50,7 +50,7 @@ class CategoryList extends React.Component {}}-CategoryList.propTypes = {+CategoryGrid.propTypes = {categories: PropTypes.array,categoryType: PropTypes.string,drawMeasurements: PropTypes.func,@@ -59,4 +59,4 @@ CategoryList.propTypes = {width: PropTypes.number};-export default CategoryList;+export default CategoryGrid;diff --git a/web/js/components/layer/product-picker/category-layer-row.js b/web/js/components/layer/product-picker/category-layer-row.jsindex 08e847074..48c3d2111 100644--- a/web/js/components/layer/product-picker/category-layer-row.js+++ b/web/js/components/layer/product-picker/category-layer-row.js@@ -157,7 +157,7 @@ class LayerRow extends React.Component {renderSourceContent(measurement, source) {return (<TabContent- className="col-md-9 col-sm-12"+ className=""id={measurement.id + '-' + source.id}><TabPane>@@ -205,7 +205,7 @@ class LayerRow extends React.Component {let validActiveIndex = activeSourceIndex;const Tabs = (- <Nav vertical className="source-tabs col-md-3 col-sm-12">+ <Nav vertical className="source-tabs">{sources.sort((a, b) => a.title.localeCompare(b.title)).map((source, index) => {@@ -230,11 +230,9 @@ class LayerRow extends React.Component {const Content = this.renderSourceContent(measurement, sources[validActiveIndex]);return (- <div className="container">- <Row>- {Tabs}- {Content}- </Row>+ <div className="measure-row-contents">+ {Tabs}+ {Content}</div>);}diff --git a/web/js/components/layer/product-picker/product-picker.js b/web/js/components/layer/product-picker/product-picker.jsindex 4796acc47..9496960b5 100644--- a/web/js/components/layer/product-picker/product-picker.js+++ b/web/js/components/layer/product-picker/product-picker.js@@ -2,7 +2,7 @@ import React from 'react';import { connect } from 'react-redux';import PropTypes from 'prop-types';import LayerList from './layer-list';-import CategoryList from './category-list';+import CategoryGrid from './category-grid';import ProductPickerHeader from './header';import {toLower as lodashToLower,@@ -394,9 +394,9 @@ class ProductPicker extends React.Component {))}</Nav><Scrollbars style={{ maxHeight: height + 'px' }}>- <div className="product-outter-list-case">- {isCategoryDisplay && (- <CategoryList+ <div>+ {isCategoryDisplay ? (+ <CategoryGridcategories={lodashValues(categoryConfig[categoryType])}measurementConfig={measurementConfig}drawMeasurements={this.drawMeasurements.bind(this)}@@ -404,7 +404,7 @@ class ProductPicker extends React.Component {categoryType={categoryType}width={width}/>- )}+ ) : this.renderLayerList()}</div></Scrollbars></>