Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

convert to single import libray approach for icons

Jason Kent1df442e76cd4
diff --git a/config/default/common/config/wv.json/projections/ui.json b/config/default/common/config/wv.json/projections/ui.json
index 588baeb24..433891f6f 100644
--- a/config/default/common/config/wv.json/projections/ui.json
+++ b/config/default/common/config/wv.json/projections/ui.json
@@ -4,17 +4,17 @@
{
"id": "arctic",
"name": "Arctic",
- "style": "faArrowCircleUp"
+ "style": "arrow-circle-up"
},
{
"id": "geographic",
"name": "Geographic",
- "style": "faCircle"
+ "style": "circle"
},
{
"id": "antarctic",
"name": "Antarctic",
- "style": "faArrowCircleDown"
+ "style": "arrow-circle-down"
}
]
}
diff --git a/web/js/app.js b/web/js/app.js
index 0537630d6..441854efb 100644
--- a/web/js/app.js
+++ b/web/js/app.js
@@ -22,6 +22,7 @@ import Brand from './brand';
import MeasureButton from './components/measure-tool/measure-button';
import FeatureAlert from './components/feature-alert/alert';
import Alerts from './containers/alerts';
+import './font-awesome-library';
// actions
import Tour from './containers/tour';
diff --git a/web/js/components/animation-widget/gif-panel-grid.js b/web/js/components/animation-widget/gif-panel-grid.js
index bf53ad191..6bf8f2f6a 100644
--- a/web/js/components/animation-widget/gif-panel-grid.js
+++ b/web/js/components/animation-widget/gif-panel-grid.js
@@ -1,8 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faTimes } from '@fortawesome/free-solid-svg-icons';
/*
* A table that updates with image
@@ -18,7 +16,7 @@ export default class GifPanelGrid extends React.Component {
if (!valid) {
return (
<div id="gif-size" className="gif-size gif-size-invalid grid-child">
- <FontAwesomeIcon icon={faTimes} fixedWidth />
+ <FontAwesomeIcon icon="times" fixedWidth />
<span>{`${maxGifSize} MB ~${roundedSize} MB`}</span>
</div>
);
diff --git a/web/js/components/animation-widget/loop-button.js b/web/js/components/animation-widget/loop-button.js
index c3171d230..b05d7256b 100644
--- a/web/js/components/animation-widget/loop-button.js
+++ b/web/js/components/animation-widget/loop-button.js
@@ -1,9 +1,7 @@
/* eslint-disable react/destructuring-assignment */
import React from 'react';
import PropTypes from 'prop-types';
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faRetweet } from '@fortawesome/free-solid-svg-icons';
/*
* @class LoopButton
@@ -19,7 +17,7 @@ const LoopButton = (props) => (
}
onClick={props.onLoop}
>
- <FontAwesomeIcon icon={faRetweet} className="wv-animation-widget-icon" />
+ <FontAwesomeIcon icon="retweet" className="wv-animation-widget-icon" />
</a>
);
diff --git a/web/js/components/animation-widget/play-button.js b/web/js/components/animation-widget/play-button.js
index ca643e747..e5a0f72d2 100644
--- a/web/js/components/animation-widget/play-button.js
+++ b/web/js/components/animation-widget/play-button.js
@@ -1,8 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faPause, faPlay } from '@fortawesome/free-solid-svg-icons';
/*
* @class PlayButton
@@ -17,8 +15,8 @@ const PlayButton = (props) => {
onClick={playing ? pause : play}
>
{playing
- ? <FontAwesomeIcon icon={faPause} className="wv-animation-widget-icon" />
- : <FontAwesomeIcon icon={faPlay} className="wv-animation-widget-icon" />}
+ ? <FontAwesomeIcon icon="pause" className="wv-animation-widget-icon" />
+ : <FontAwesomeIcon icon="play" className="wv-animation-widget-icon" />}
</a>
);
};
diff --git a/web/js/components/image-download/grid.js b/web/js/components/image-download/grid.js
index ce9e42332..5d6fb2fb9 100644
--- a/web/js/components/image-download/grid.js
+++ b/web/js/components/image-download/grid.js
@@ -1,8 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faTimes } from '@fortawesome/free-solid-svg-icons';
import Button from '../util/button';
/*
@@ -21,7 +19,7 @@ export default class ResolutionTable extends React.Component {
id="wv-image-size"
className="wv-image-size wv-image-size-invalid grid-child"
>
- <FontAwesomeIcon icon={faTimes} fixedWidth />
+ <FontAwesomeIcon icon="times" fixedWidth />
<span>{`~${fileSize}MB`}</span>
</div>
);
diff --git a/web/js/components/layer/product-picker/browse/browse-layers.js b/web/js/components/layer/product-picker/browse/browse-layers.js
index 385fe323e..e1eeba70c 100644
--- a/web/js/components/layer/product-picker/browse/browse-layers.js
+++ b/web/js/components/layer/product-picker/browse/browse-layers.js
@@ -13,7 +13,6 @@ import {
Tooltip,
} from 'reactstrap';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faClock, faQuestionCircle } from '@fortawesome/free-regular-svg-icons';
import BrowseLayerList from './browse-layers-list';
import CategoryGrid from './category-grid';
import MeasurementMetadataDetail from './measurement-metadata-detail';
@@ -109,7 +108,7 @@ function BrowseLayers (props) {
: 'layer-category-navigation');
const recentTab = (sortKey) => (
<NavLink onClick={() => selectTab(sortKey)}>
- <FontAwesomeIcon icon={faClock} />
+ <FontAwesomeIcon icon="clock" />
Recent
</NavLink>
);
@@ -154,7 +153,7 @@ function BrowseLayers (props) {
<FontAwesomeIcon
id="recent-tooltip-target"
className="recent-tooltip-icon"
- icon={faQuestionCircle}
+ icon="question-circle"
/>
<Button
id="clear-recent-layers"
@@ -177,7 +176,7 @@ function BrowseLayers (props) {
className="categories-dropdown"
>
<DropdownToggle caret>
- {categoryType === 'recent' && (<FontAwesomeIcon icon={faClock} />)}
+ {categoryType === 'recent' && (<FontAwesomeIcon icon="clock" />)}
{categoryType}
</DropdownToggle>
<DropdownMenu className="categories-dropdown-menu">
diff --git a/web/js/components/layer/product-picker/browse/category-layer-row.js b/web/js/components/layer/product-picker/browse/category-layer-row.js
index 04a8636fa..584637f6b 100644
--- a/web/js/components/layer/product-picker/browse/category-layer-row.js
+++ b/web/js/components/layer/product-picker/browse/category-layer-row.js
@@ -9,7 +9,6 @@ import {
ListGroup,
} from 'reactstrap';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faChevronCircleDown, faChevronCircleRight } from '@fortawesome/free-solid-svg-icons';
import { getOrbitTrackTitle } from '../../../../modules/layers/util';
import MeasurementLayerRow from './measurement-layer-row';
import MeasurementMetadataDetail from './measurement-metadata-detail';
@@ -215,8 +214,8 @@ class CategoryLayerRow extends React.Component {
<h3>{measurement.title}</h3>
{measurement.subtitle && !isSelected && <h5>{measurement.subtitle}</h5>}
{isSelected
- ? <FontAwesomeIcon icon={faChevronCircleDown} className="arrow-icon" />
- : <FontAwesomeIcon icon={faChevronCircleRight} className="arrow-icon" />}
+ ? <FontAwesomeIcon icon="chevron-circle-down" className="arrow-icon" />
+ : <FontAwesomeIcon icon="chevron-circle-right" className="arrow-icon" />}
</div>
{isSelected ? this.renderContent() : ''}
</div>
diff --git a/web/js/components/layer/product-picker/browse/measurement-layer-row.js b/web/js/components/layer/product-picker/browse/measurement-layer-row.js
index b0f3119d4..2c4ad4ced 100644
--- a/web/js/components/layer/product-picker/browse/measurement-layer-row.js
+++ b/web/js/components/layer/product-picker/browse/measurement-layer-row.js
@@ -3,7 +3,6 @@ import PropTypes from 'prop-types';
import { ListGroupItem, UncontrolledTooltip } from 'reactstrap';
import { connect } from 'react-redux';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faBan, faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';
import { available, getActiveLayers } from '../../../../modules/layers/selectors';
import Checkbox from '../../../util/checkbox';
import {
@@ -59,8 +58,8 @@ function MeasurementLayerRow (props) {
label={title}
classNames="settings-check"
>
- {layerIsUnavailable && (<FontAwesomeIcon icon={faBan} id="availability-info" />)}
- {layerNotices && (<FontAwesomeIcon icon={faExclamationTriangle} id="notice-info" />)}
+ {layerIsUnavailable && (<FontAwesomeIcon icon="ban" id="availability-info" />)}
+ {layerNotices && (<FontAwesomeIcon icon="exclamation-triangle" id="notice-info" />)}
{(layerNotices || layerIsUnavailable) && (
<UncontrolledTooltip
target={itemElementId}
diff --git a/web/js/components/layer/product-picker/browse/measurement-metadata-detail.js b/web/js/components/layer/product-picker/browse/measurement-metadata-detail.js
index f282b7a75..9650ea609 100644
--- a/web/js/components/layer/product-picker/browse/measurement-metadata-detail.js
+++ b/web/js/components/layer/product-picker/browse/measurement-metadata-detail.js
@@ -2,7 +2,6 @@ import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faMap, faMeteor } from '@fortawesome/free-solid-svg-icons';
import util from '../../../../util/util';
import { getMeasurementSource } from '../../../../modules/product-picker/selectors';
@@ -85,7 +84,7 @@ class MeasurementMetadataDetail extends React.Component {
if (!isMobile && !source) {
return (
<div className="no-results">
- <FontAwesomeIcon icon={faMap} />
+ <FontAwesomeIcon icon="map" />
<h3>{categoryTitle}</h3>
<h5> Select a measurement to view details here!</h5>
</div>
@@ -96,7 +95,7 @@ class MeasurementMetadataDetail extends React.Component {
if (!description) {
return (
<div className="no-results">
- <FontAwesomeIcon icon={faMeteor} />
+ <FontAwesomeIcon icon="meteor" />
<h3> No metadata found. </h3>
</div>
);
diff --git a/web/js/components/layer/product-picker/browse/recent-layers-info.js b/web/js/components/layer/product-picker/browse/recent-layers-info.js
index eb455805a..db3cc2990 100644
--- a/web/js/components/layer/product-picker/browse/recent-layers-info.js
+++ b/web/js/components/layer/product-picker/browse/recent-layers-info.js
@@ -1,12 +1,11 @@
import React from 'react';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faClock } from '@fortawesome/free-regular-svg-icons';
import { recentLayerInfo } from '../../../../modules/product-picker/util';
export default function RecentLayersInfo (props) {
return (
<div className="no-results">
- <FontAwesomeIcon icon={faClock} />
+ <FontAwesomeIcon icon="clock" />
<h3> Recently Used Layers </h3>
<p>
{recentLayerInfo}
diff --git a/web/js/components/layer/product-picker/browse/recent-layers.js b/web/js/components/layer/product-picker/browse/recent-layers.js
index 6d22fd7a5..c116f0cae 100644
--- a/web/js/components/layer/product-picker/browse/recent-layers.js
+++ b/web/js/components/layer/product-picker/browse/recent-layers.js
@@ -3,7 +3,6 @@ import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { Button, Tooltip } from 'reactstrap';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faQuestionCircle } from '@fortawesome/free-regular-svg-icons';
import SearchLayerList from '../search/search-layers-list';
import LayerMetadataDetail from '../search/layer-metadata-detail';
@@ -44,7 +43,7 @@ function RecentLayersList(props) {
id="recent-layer-tooltip-target"
className="tooltip-icon"
size="lg"
- icon={faQuestionCircle}
+ icon="question-circle"
/>
<Button id="clear-recent-layers" size="sm" onClick={clearRecentLayers}>
Clear List
diff --git a/web/js/components/layer/product-picker/header.js b/web/js/components/layer/product-picker/header.js
index 35f6af33e..98cd45413 100644
--- a/web/js/components/layer/product-picker/header.js
+++ b/web/js/components/layer/product-picker/header.js
@@ -9,7 +9,6 @@ import {
BreadcrumbItem,
} from 'reactstrap';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faFilter, faArrowLeft } from '@fortawesome/free-solid-svg-icons';
import { withSearch } from '@elastic/react-search-ui';
import {
selectLayer as selectLayerAction,
@@ -153,7 +152,7 @@ class ProductPickerHeader extends React.Component {
color="secondary"
onClick={this.revertToInitialScreen}
>
- <FontAwesomeIcon icon={faArrowLeft} />
+ <FontAwesomeIcon icon="arrow-left" />
</Button>
{isBreadCrumb && this.renderBreadCrumb()}
</>
@@ -174,7 +173,7 @@ class ProductPickerHeader extends React.Component {
onClick={filterBtnFn}
title="Filter layer results"
>
- <FontAwesomeIcon icon={faFilter} />
+ <FontAwesomeIcon icon="filter" />
</Button>
)}
diff --git a/web/js/components/layer/product-picker/search/filter-chips.js b/web/js/components/layer/product-picker/search/filter-chips.js
index e55120779..a020aef66 100644
--- a/web/js/components/layer/product-picker/search/filter-chips.js
+++ b/web/js/components/layer/product-picker/search/filter-chips.js
@@ -1,7 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faTimes } from '@fortawesome/free-solid-svg-icons';
export default function FilterChips(props) {
const {
@@ -31,7 +30,7 @@ export default function FilterChips(props) {
>
{displayValue}
<FontAwesomeIcon
- icon={faTimes}
+ icon="timies"
fixedWidth
/>
</div>
diff --git a/web/js/components/layer/product-picker/search/layer-metadata-detail.js b/web/js/components/layer/product-picker/search/layer-metadata-detail.js
index a6b4de910..1090aa298 100644
--- a/web/js/components/layer/product-picker/search/layer-metadata-detail.js
+++ b/web/js/components/layer/product-picker/search/layer-metadata-detail.js
@@ -2,13 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { ListGroup, ListGroupItem, Button } from 'reactstrap';
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import {
- faMinus,
- faPlus,
- faGlobeAmericas,
-} from '@fortawesome/free-solid-svg-icons';
import util from '../../../../util/util';
import { dateOverlap } from '../../../../modules/layers/util';
import {
@@ -162,7 +156,7 @@ class LayerMetadataDetail extends React.Component {
? (<RecentLayersInfo />)
: (
<div className="no-results">
- <FontAwesomeIcon icon={faGlobeAmericas} />
+ <FontAwesomeIcon icon="globe-americas" />
<h3> No layer selected. </h3>
<h5> Select a layer to view details here!</h5>
</div>
@@ -180,14 +174,14 @@ class LayerMetadataDetail extends React.Component {
const previewUrl = `images/layers/previews/${selectedProjection}/${layer.id}.jpg`;
const buttonText = isActive ? 'Remove Layer' : 'Add Layer';
const btnClass = isActive ? 'add-to-map-btn text-center is-active' : 'add-to-map-btn text-center';
- const btnIconClass = isActive ? faMinus : faPlus;
+ const btnIconClass = isActive ? 'minus' : 'plus';
return (
<div className="layers-all-layer">
<div className="layers-all-header">
<RenderSplitLayerTitle layer={layer} />
- {/* NOTE - NEED TO ADD faChevronDown TO FONT AWESOME IMPORT ABOVE FROM '@fortawesome/free-solid-svg-icons'
+ {/*
<Button className="close-details" onClick={() => selectLayer(null)}>
- <FontAwesomeIcon icon={faChevronDown} />
+ <FontAwesomeIcon icon="chevron-down" />
</Button>
*/}
</div>
diff --git a/web/js/components/layer/product-picker/search/product-facet.js b/web/js/components/layer/product-picker/search/product-facet.js
index 15ccdcce6..9b4a3cc29 100644
--- a/web/js/components/layer/product-picker/search/product-facet.js
+++ b/web/js/components/layer/product-picker/search/product-facet.js
@@ -2,11 +2,6 @@ import React, { useState } from 'react';
import PropTypes from 'prop-types';
import { Facet } from '@elastic/react-search-ui';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import {
- faCaretDown,
- faCaretRight,
- faInfoCircle,
-} from '@fortawesome/free-solid-svg-icons';
import { Tooltip } from 'reactstrap';
function ProductFacet(props) {
@@ -44,11 +39,11 @@ function ProductFacet(props) {
<FontAwesomeIcon
id={`${field}-tooltip-target`}
className="facet-tooltip"
- icon={faInfoCircle}
+ icon="info-circle"
/>
<FontAwesomeIcon
className={`facet-collapse-toggle ${!data.length && 'hidden'}`}
- icon={!collapsed ? faCaretDown : faCaretRight}
+ icon={!collapsed ? 'caret-down' : 'caret-right'}
onClick={() => toggleCollapse(field)}
/>
</>
diff --git a/web/js/components/layer/product-picker/search/search-layer-row.js b/web/js/components/layer/product-picker/search/search-layer-row.js
index a887ffcd6..262bde22f 100644
--- a/web/js/components/layer/product-picker/search/search-layer-row.js
+++ b/web/js/components/layer/product-picker/search/search-layer-row.js
@@ -2,7 +2,6 @@ import React from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faTrash, faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';
import { Button, UncontrolledTooltip } from 'reactstrap';
import {
addLayer as addLayerAction,
@@ -134,7 +133,7 @@ class SearchLayerRow extends React.Component {
<FontAwesomeIcon
id={`${encodedId}-notice-info`}
className="layer-notice-icon"
- icon={faExclamationTriangle}
+ icon="exclamation-triangle"
/>
<UncontrolledTooltip
className="zot-tooltip"
@@ -157,7 +156,7 @@ class SearchLayerRow extends React.Component {
title="Remove from recent layers list."
onClick={(e) => clearSingleRecentLayer(e, layer)}
>
- <FontAwesomeIcon icon={faTrash} />
+ <FontAwesomeIcon icon="trash" />
</Button>
)}
</div>
diff --git a/web/js/components/layer/product-picker/search/search-layers-list.js b/web/js/components/layer/product-picker/search/search-layers-list.js
index 0b89417ba..26375ab86 100644
--- a/web/js/components/layer/product-picker/search/search-layers-list.js
+++ b/web/js/components/layer/product-picker/search/search-layers-list.js
@@ -4,7 +4,6 @@ import { connect } from 'react-redux';
import { withSearch } from '@elastic/react-search-ui';
import InfiniteScroll from 'react-infinite-scroller';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faMeteor } from '@fortawesome/free-solid-svg-icons';
import SwipeToDelete from 'react-swipe-to-delete-component';
import SearchLayerRow from './search-layer-row';
import 'whatwg-fetch'; // fetch() polyfill for IE
@@ -146,7 +145,7 @@ class SearchLayerList extends React.Component {
? (<RecentLayersInfo />)
: (
<div className="no-results">
- <FontAwesomeIcon icon={faMeteor} size="5x" />
+ <FontAwesomeIcon icon="meteor" size="5x" />
<h3> No layers found! </h3>
</div>
);
diff --git a/web/js/components/measure-tool/measure-button.js b/web/js/components/measure-tool/measure-button.js
index 8a4b1a8b5..1453ba49d 100644
--- a/web/js/components/measure-tool/measure-button.js
+++ b/web/js/components/measure-tool/measure-button.js
@@ -4,7 +4,6 @@ import { connect } from 'react-redux';
import { Button } from 'reactstrap';
import googleTagManager from 'googleTagManager';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faRuler } from '@fortawesome/free-solid-svg-icons';
import MeasureMenu from './measure-menu';
import { openCustomContent } from '../../modules/modal/actions';
import AlertUtil from '../util/alert';
@@ -66,7 +65,7 @@ class MeasureButton extends React.Component {
<AlertUtil
id="measurement-alert"
isOpen
- iconClassName="faRuler"
+ iconClassName="ruler"
title="Measure Tool"
message={message}
onDismiss={this.dismissAlert}
@@ -82,7 +81,7 @@ class MeasureButton extends React.Component {
onMouseDown={this.onButtonClick}
disabled={isActive}
>
- <FontAwesomeIcon icon={faRuler} size="2x" />
+ <FontAwesomeIcon icon="ruler" size="2x" />
</Button>
</>
);
diff --git a/web/js/components/measure-tool/measure-menu.js b/web/js/components/measure-tool/measure-menu.js
index e39f387ad..a9669fcfd 100644
--- a/web/js/components/measure-tool/measure-menu.js
+++ b/web/js/components/measure-tool/measure-menu.js
@@ -10,7 +10,7 @@ import { changeUnits } from '../../modules/measure/actions';
const DOWNLOAD_GEOJSON = {
text: 'Download as GeoJSON',
iconClass: 'ui-icon icon-large',
- iconName: 'faDownload',
+ iconName: 'download',
id: 'download-geojson-button',
key: 'measure-download-geojson',
className: 'measure-download',
@@ -18,7 +18,7 @@ const DOWNLOAD_GEOJSON = {
const DOWNLOAD_SHAPEFILE = {
text: 'Download as Shapefiles',
iconClass: 'ui-icon icon-large',
- iconName: 'faDownload',
+ iconName: 'download',
id: 'download-shapefiles-button',
key: 'measure-download-shapefile',
};
@@ -26,21 +26,21 @@ const OPTIONS_ARRAY = [
{
text: 'Measure distance',
iconClass: 'ui-icon icon-large',
- iconName: 'faRuler',
+ iconName: 'ruler',
id: 'measure-distance-button',
key: 'measure-distance',
},
{
text: 'Measure area',
iconClass: 'ui-icon icon-large',
- iconName: 'faRulerCombined',
+ iconName: 'ruler-combined',
id: 'measure-area-button',
key: 'measure-area',
},
{
text: 'Remove Measurements',
iconClass: 'ui-icon icon-large',
- iconName: 'faTrash',
+ iconName: 'trash',
id: 'clear-measurements-button',
key: 'measure-clear',
},
diff --git a/web/js/components/measure-tool/measure-tooltip.js b/web/js/components/measure-tool/measure-tooltip.js
index cf1383667..00a119ff6 100644
--- a/web/js/components/measure-tool/measure-tooltip.js
+++ b/web/js/components/measure-tool/measure-tooltip.js
@@ -7,7 +7,6 @@ import {
} from 'ol/geom';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faTimes } from '@fortawesome/free-solid-svg-icons';
import {
getGeographicLibDistance,
getGeographicLibArea,
@@ -107,7 +106,7 @@ export default function MeasureTooltip(props) {
<span dangerouslySetInnerHTML={{ __html: getMeasurementValue() }} />
{!active && (
<span className="remove-measurement" onClick={onRemove}>
- <FontAwesomeIcon icon={faTimes} fixedWidth />
+ <FontAwesomeIcon icon="times" fixedWidth />
</span>
)}
</div>
diff --git a/web/js/components/notifications/notification-block.js b/web/js/components/notifications/notification-block.js
index 0b60e3180..ee9a25842 100644
--- a/web/js/components/notifications/notification-block.js
+++ b/web/js/components/notifications/notification-block.js
@@ -1,19 +1,13 @@
import React from 'react';
import PropTypes from 'prop-types';
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import {
- faBolt,
- faExclamationCircle,
- faGift,
-} from '@fortawesome/free-solid-svg-icons';
import util from '../../util/util';
// icons used with NotificationBlock by passing string as prop type
const listIcons = {
- alert: faBolt,
- message: faGift,
- outage: faExclamationCircle,
+ alert: ['fas', 'bolt'],
+ message: 'gift',
+ outage: 'exclamation-circle',
};
const NotificationBlock = (props) => {
diff --git a/web/js/components/sidebar/collapsed-button.js b/web/js/components/sidebar/collapsed-button.js
index b5fd779e8..024f9ed60 100644
--- a/web/js/components/sidebar/collapsed-button.js
+++ b/web/js/components/sidebar/collapsed-button.js
@@ -1,8 +1,6 @@
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faLayerGroup } from '@fortawesome/free-solid-svg-icons';
class CollapsedButton extends PureComponent {
render() {
@@ -26,7 +24,7 @@ class CollapsedButton extends PureComponent {
title="Show Layer Selector"
onClick={onclick}
>
- <FontAwesomeIcon icon={faLayerGroup} />
+ <FontAwesomeIcon icon="layer-group" />
{isMobile
? (
<span className="layer-count mobile">
diff --git a/web/js/components/sidebar/event.js b/web/js/components/sidebar/event.js
index 65003f686..03a38a20c 100644
--- a/web/js/components/sidebar/event.js
+++ b/web/js/components/sidebar/event.js
@@ -2,9 +2,7 @@ import React, { useEffect } from 'react';
import PropTypes from 'prop-types';
import lodashFind from 'lodash/find';
import googleTagManager from 'googleTagManager';
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faExternalLinkAlt } from '@fortawesome/free-solid-svg-icons';
import util from '../../util/util';
function Event (props) {
@@ -117,7 +115,7 @@ function Event (props) {
e.stopPropagation();
}}
>
- <FontAwesomeIcon icon={faExternalLinkAlt} />
+ <FontAwesomeIcon icon="external-link-alt" />
{` ${source.title}`}
</a>
);
diff --git a/web/js/components/sidebar/nav/nav-case.js b/web/js/components/sidebar/nav/nav-case.js
index d7e250fb7..7699991f3 100644
--- a/web/js/components/sidebar/nav/nav-case.js
+++ b/web/js/components/sidebar/nav/nav-case.js
@@ -25,7 +25,7 @@ class NavCase extends React.Component {
id="download"
iconClassName="icon-download"
disabled={!!isCompareMode}
- title={
+ label={
isCompareMode
? 'You must exit comparison mode to download data'
: 'Data download'
diff --git a/web/js/components/sidebar/nav/nav-item.js b/web/js/components/sidebar/nav/nav-item.js
index 9a399ba4f..f70285631 100644
--- a/web/js/components/sidebar/nav/nav-item.js
+++ b/web/js/components/sidebar/nav/nav-item.js
@@ -1,19 +1,20 @@
import React from 'react';
import PropTypes from 'prop-types';
-import { NavItem, NavLink } from 'reactstrap';
+import { NavItem, NavLink, UncontrolledTooltip } from 'reactstrap';
const CustomNavItem = (props) => {
const {
isMobile,
shouldHideInMobile,
isDisabled,
- title,
+ label,
className,
onTabClick,
id,
iconClassName,
text,
} = props;
+ const tabId = `${id}-sidebar-tab`;
return (
<NavItem
style={
@@ -24,11 +25,18 @@ const CustomNavItem = (props) => {
>
<NavLink
disabled={isDisabled}
- title={title}
+ aria-label={label}
className={className}
- id={`${id}-sidebar-tab`}
+ id={tabId}
onClick={() => onTabClick(id)}
>
+ <UncontrolledTooltip
+ target={tabId}
+ boundariesElement="window"
+ placement="bottom"
+ >
+ {label}
+ </UncontrolledTooltip>
<i className={`productsIcon selected ${iconClassName}`} />
{text}
</NavLink>
@@ -45,7 +53,7 @@ CustomNavItem.propTypes = {
onTabClick: PropTypes.func,
shouldHideInMobile: PropTypes.bool,
text: PropTypes.string,
- title: PropTypes.string,
+ label: PropTypes.string,
};
export default CustomNavItem;
diff --git a/web/js/components/timeline/custom-interval-selector/interval-selector-widget.js b/web/js/components/timeline/custom-interval-selector/interval-selector-widget.js
index 4bdac30e8..8caa3c736 100644
--- a/web/js/components/timeline/custom-interval-selector/interval-selector-widget.js
+++ b/web/js/components/timeline/custom-interval-selector/interval-selector-widget.js
@@ -2,7 +2,6 @@ import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faTimes } from '@fortawesome/free-solid-svg-icons';
import DeltaInput from './delta-input';
import TimeScaleSelect from './interval-select';
import {
@@ -75,7 +74,7 @@ class CustomIntervalSelectorWidget extends PureComponent {
changeZoomLevel={this.changeZoomLevel}
/>
</div>
- <FontAwesomeIcon icon={faTimes} className="wv-close" onClick={closeModal} />
+ <FontAwesomeIcon icon="times" className="wv-close" onClick={closeModal} />
</div>
);
}
diff --git a/web/js/components/timeline/timeline-controls/animation-button.js b/web/js/components/timeline/timeline-controls/animation-button.js
index 2d3c4a2b6..442755c81 100644
--- a/web/js/components/timeline/timeline-controls/animation-button.js
+++ b/web/js/components/timeline/timeline-controls/animation-button.js
@@ -1,8 +1,6 @@
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faVideo } from '@fortawesome/free-solid-svg-icons';
class AnimationButton extends PureComponent {
render() {
@@ -14,7 +12,7 @@ class AnimationButton extends PureComponent {
title={title || 'Set up animation'}
>
<div id="animate-button" onClick={clickAnimationButton}>
- <FontAwesomeIcon icon={faVideo} className="wv-animate" size="3x" />
+ <FontAwesomeIcon icon="video" className="wv-animate" size="3x" />
</div>
</div>
);
diff --git a/web/js/components/timeline/timeline-data/data-item-list.js b/web/js/components/timeline/timeline-data/data-item-list.js
index eb83f9f2f..ee1d80d92 100644
--- a/web/js/components/timeline/timeline-data/data-item-list.js
+++ b/web/js/components/timeline/timeline-data/data-item-list.js
@@ -3,7 +3,6 @@ import React, { Component } from 'react';
import PropTypes from 'prop-types';
import moment from 'moment';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';
import { datesinDateRanges } from '../../../modules/layers/util';
import util from '../../../util/util';
import {
@@ -335,7 +334,7 @@ class DataItemList extends Component {
createEmptyLayersDOMEl = () => (
<div className="data-panel-layer-empty">
<div className="data-item-empty">
- <FontAwesomeIcon icon={faExclamationTriangle} className="error-icon" />
+ <FontAwesomeIcon icon="exclamation-triangle" className="error-icon" />
<p>No visible layers with defined coverage. Add layers or toggle &quot;Include Hidden Layers&quot; if current layers are hidden.</p>
</div>
</div>
diff --git a/web/js/components/toolbar/share/links.js b/web/js/components/toolbar/share/links.js
index 1754969d0..399c0a611 100644
--- a/web/js/components/toolbar/share/links.js
+++ b/web/js/components/toolbar/share/links.js
@@ -1,9 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faEnvelope } from '@fortawesome/free-solid-svg-icons';
-import { faFacebookF, faTwitter, faRedditAlien } from '@fortawesome/free-brands-svg-icons';
class ShareLinks extends React.Component {
onClick(event, type) {
@@ -21,7 +18,7 @@ class ShareLinks extends React.Component {
onClick={(e) => this.onClick(e, 'facebook')}
title="Share via Facebook!"
>
- <FontAwesomeIcon icon={faFacebookF} />
+ <FontAwesomeIcon icon={['fab', 'facebook-f']} />
</a>
<a
id="tw-share"
@@ -29,7 +26,7 @@ class ShareLinks extends React.Component {
onClick={(e) => this.onClick(e, 'twitter')}
title="Share via Twitter!"
>
- <FontAwesomeIcon icon={faTwitter} />
+ <FontAwesomeIcon icon={['fab', 'twitter']} />
</a>
<a
id="rd-share"
@@ -37,7 +34,7 @@ class ShareLinks extends React.Component {
onClick={(e) => this.onClick(e, 'reddit')}
title="Share via Reddit!"
>
- <FontAwesomeIcon icon={faRedditAlien} />
+ <FontAwesomeIcon icon={['fab', 'reddit-alien']} />
</a>
<a
id="email-share"
@@ -45,7 +42,7 @@ class ShareLinks extends React.Component {
onClick={(e) => this.onClick(e, 'email')}
title="Share via Email!"
>
- <FontAwesomeIcon icon={faEnvelope} />
+ <FontAwesomeIcon icon="envelope" />
</a>
</div>
);
diff --git a/web/js/components/tour/content-intro.js b/web/js/components/tour/content-intro.js
index 178924914..966b06a31 100644
--- a/web/js/components/tour/content-intro.js
+++ b/web/js/components/tour/content-intro.js
@@ -1,9 +1,7 @@
/* eslint-disable react/destructuring-assignment */
import React from 'react';
import PropTypes from 'prop-types';
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faArrowRight } from '@fortawesome/free-solid-svg-icons';
const TourIntro = (props) => (
<div className="tour-intro">
@@ -13,7 +11,7 @@ const TourIntro = (props) => (
{' '}
<a href="#" title="Start using Worldview" onClick={props.toggleModalStart}>
Start using Worldview
- <FontAwesomeIcon icon={faArrowRight} />
+ <FontAwesomeIcon icon="arrow-right" />
</a>
</p>
</div>
diff --git a/web/js/components/tour/widget-steps.js b/web/js/components/tour/widget-steps.js
index b51ed68f6..4487e2796 100644
--- a/web/js/components/tour/widget-steps.js
+++ b/web/js/components/tour/widget-steps.js
@@ -1,8 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faCheckCircle, faArrowCircleLeft, faArrowCircleRight } from '@fortawesome/free-solid-svg-icons';
const Steps = (props) => {
const {
@@ -15,7 +13,7 @@ const Steps = (props) => {
aria-label="Previous"
onClick={decreaseStep}
>
- <FontAwesomeIcon icon={faArrowCircleLeft} />
+ <FontAwesomeIcon icon="arrow-circle-left" />
</a>
<div className="step-counter">
<p>
@@ -32,8 +30,8 @@ const Steps = (props) => {
onClick={incrementStep}
>
{currentStep === totalSteps
- ? <FontAwesomeIcon icon={faCheckCircle} />
- : <FontAwesomeIcon icon={faArrowCircleRight} />}
+ ? <FontAwesomeIcon icon="check-circle" />
+ : <FontAwesomeIcon icon="arrow-circle-right" />}
</a>
</div>
);
diff --git a/web/js/components/util/alert.js b/web/js/components/util/alert.js
index f28b91239..13b694e66 100644
--- a/web/js/components/util/alert.js
+++ b/web/js/components/util/alert.js
@@ -2,17 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import { Alert } from 'reactstrap';
import { Portal } from 'react-portal';
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import {
- faLayerGroup, faTimes, faRuler, faExclamationTriangle,
-} from '@fortawesome/free-solid-svg-icons';
-
-// icons used with alert by passing string as prop iconClassName
-const alertIcons = {
- faRuler,
- faLayerGroup,
-};
/*
* A react component, Builds a rather specific
@@ -52,9 +42,7 @@ export default class AlertUtil extends React.Component {
onClick,
} = this.props;
- const icon = iconClassName
- ? alertIcons[iconClassName] || faExclamationTriangle
- : faExclamationTriangle;
+ const icon = iconClassName || 'exclamation-triangle';
return (
<Alert
id={id}
@@ -73,7 +61,7 @@ export default class AlertUtil extends React.Component {
</div>
{onDismiss && (
<div id={`${id}-close`} className="close-alert" onClick={onDismiss}>
- <FontAwesomeIcon icon={faTimes} className="exit" size="1x" />
+ <FontAwesomeIcon icon="times" className="exit" size="1x" />
</div>
)}
</Alert>
diff --git a/web/js/components/util/list.js b/web/js/components/util/list.js
index fc9a9c4cf..ef2166bad 100644
--- a/web/js/components/util/list.js
+++ b/web/js/components/util/list.js
@@ -1,46 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { ListGroup, ListGroupItem, Badge } from 'reactstrap';
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import {
- faArrowCircleDown,
- faArrowCircleUp,
- faBolt,
- faCircle,
- faCode,
- faDownload,
- faEnvelope,
- faEye,
- faExclamationCircle,
- faFile,
- faFlag,
- faGift,
- faRuler,
- faRulerCombined,
- faTrash,
- faTruck,
-} from '@fortawesome/free-solid-svg-icons';
-
-// icons used with List by passing string as prop iconClass
-const listIcons = {
- faArrowCircleDown,
- faArrowCircleUp,
- faBolt,
- faCircle,
- faCode,
- faDownload,
- faEnvelope,
- faExclamationCircle,
- faEye,
- faFile,
- faFlag,
- faGift,
- faRuler,
- faRulerCombined,
- faTrash,
- faTruck,
-};
/*
* A react reuseable list component
@@ -80,7 +41,7 @@ export default function List(props) {
onClick={onClickFn}
disabled={isDisabled}
>
- {iconName ? <FontAwesomeIcon icon={listIcons[iconName]} className={iconClass} fixedWidth /> : ''}
+ {iconName ? <FontAwesomeIcon icon={iconName} className={iconClass} fixedWidth /> : ''}
{text || ''}
{badge ? <Badge pill>{badge}</Badge> : ''}
</ListGroupItem>
diff --git a/web/js/components/util/switch.js b/web/js/components/util/switch.js
index 6855cdaff..989b66180 100644
--- a/web/js/components/util/switch.js
+++ b/web/js/components/util/switch.js
@@ -1,9 +1,7 @@
import React, { useState, useEffect } from 'react';
import PropTypes from 'prop-types';
import { Tooltip } from 'reactstrap';
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faInfoCircle } from '@fortawesome/free-solid-svg-icons';
// https://upmostly.com/tutorials/build-a-react-switch-toggle-component
const Switch = (props) => {
@@ -61,7 +59,7 @@ const Switch = (props) => {
{tooltip
&& (
<>
- <FontAwesomeIcon icon={faInfoCircle} id="switch-tooltip" />
+ <FontAwesomeIcon icon="info-circle" id="switch-tooltip" />
<Tooltip
placement="right"
isOpen={tooltipOpen}
diff --git a/web/js/components/vector-metadata/tooltip.js b/web/js/components/vector-metadata/tooltip.js
index 6018cd73e..dda20bf77 100644
--- a/web/js/components/vector-metadata/tooltip.js
+++ b/web/js/components/vector-metadata/tooltip.js
@@ -1,9 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Tooltip } from 'reactstrap';
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faInfo } from '@fortawesome/free-solid-svg-icons';
import util from '../../util/util';
export default class VectorMetaTooltip extends React.Component {
@@ -49,7 +47,7 @@ export default class VectorMetaTooltip extends React.Component {
key={elId}
>
<div id={elId} className="sub-case">
- <FontAwesomeIcon icon={faInfo} className="vector-info-icon cursor-pointer" />
+ <FontAwesomeIcon icon="info" className="vector-info-icon cursor-pointer" />
</div>
<Tooltip
dangerouslySetInnerHTML={{ __html: description }}
diff --git a/web/js/containers/animation-widget.js b/web/js/containers/animation-widget.js
index c2c10fd44..786cf8bd3 100644
--- a/web/js/containers/animation-widget.js
+++ b/web/js/containers/animation-widget.js
@@ -11,9 +11,6 @@ import Slider, { Handle } from 'rc-slider';
import { Tooltip } from 'reactstrap';
import Draggable from 'react-draggable';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import {
- faChevronUp, faChevronDown, faTimes, faFileVideo,
-} from '@fortawesome/free-solid-svg-icons';
import util from '../util/util';
import ErrorBoundary from './error-boundary';
import TimeSelector from '../components/date-selector/date-selector';
@@ -441,8 +438,8 @@ class AnimationWidget extends React.Component {
play={this.onPushPlay}
pause={onPushPause}
/>
- <FontAwesomeIcon icon={faChevronUp} className="wv-expand" onClick={this.toggleCollapse} />
- <FontAwesomeIcon icon={faTimes} className="wv-close" onClick={onClose} />
+ <FontAwesomeIcon icon="chevron-up" className="wv-expand" onClick={this.toggleCollapse} />
+ <FontAwesomeIcon icon="times" className="wv-close" onClick={onClose} />
</div>
</div>
</Draggable>
@@ -528,7 +525,7 @@ class AnimationWidget extends React.Component {
onMouseEnter={this.toggleHoverGif}
onMouseLeave={this.toggleHoverGif}
>
- <FontAwesomeIcon icon={faFileVideo} id="wv-animation-widget-file-video-icon" className="wv-animation-widget-icon" />
+ <FontAwesomeIcon icon="file-video" id="wv-animation-widget-file-video-icon" className="wv-animation-widget-icon" />
</a>
{this.renderToolTip()}
@@ -554,8 +551,8 @@ class AnimationWidget extends React.Component {
subDailyMode={subDailyMode}
/>
</div>
- <FontAwesomeIcon icon={faChevronDown} className="wv-minimize" onClick={this.toggleCollapse} />
- <FontAwesomeIcon icon={faTimes} className="wv-close" onClick={onClose} />
+ <FontAwesomeIcon icon="chevron-down" className="wv-minimize" onClick={this.toggleCollapse} />
+ <FontAwesomeIcon icon="times" className="wv-close" onClick={onClose} />
{/* Custom time interval selection */}
<CustomIntervalSelectorWidget
diff --git a/web/js/containers/error-boundary.js b/web/js/containers/error-boundary.js
index 53670add2..736651119 100644
--- a/web/js/containers/error-boundary.js
+++ b/web/js/containers/error-boundary.js
@@ -1,16 +1,14 @@
import React from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';
import { openCustomContent } from '../modules/modal/actions';
const HEADER_TEXT = 'Error!';
const BODY_COMPONENT = () => (
<>
<div className="error-header">
- <FontAwesomeIcon icon={faExclamationTriangle} className="error-icon" size="3x" />
+ <FontAwesomeIcon icon="exclamation-triangle" className="error-icon" size="3x" />
An unexpected error has occurred!
</div>
<div className="error-body">
diff --git a/web/js/containers/info.js b/web/js/containers/info.js
index e95813135..b4a839ad7 100644
--- a/web/js/containers/info.js
+++ b/web/js/containers/info.js
@@ -41,10 +41,10 @@ function InfoList (props) {
iconClass: 'ui-icon',
// eslint-disable-next-line no-nested-ternary
iconName: type === 'message'
- ? 'faGift'
+ ? 'gift'
: type === 'outage'
- ? 'faExclamationCircle'
- : 'faBolt',
+ ? 'exclamation-circle'
+ : ['fas', 'bolt'],
id: 'notifications_info_item',
badge: number,
className: type ? `${type}-notification` : '',
@@ -58,7 +58,7 @@ function InfoList (props) {
const distractionFreeObj = {
text: isDistractionFreeModeActive ? 'Exit Distraction Free' : 'Distraction Free',
iconClass: 'ui-icon',
- iconName: 'faEye',
+ iconName: ['far', 'eye'],
id: 'distraction_free_info_item',
onClick: () => {
toggleDistractionFreeMode();
@@ -76,28 +76,28 @@ function InfoList (props) {
{
text: 'Send feedback',
iconClass: 'ui-icon',
- iconName: 'faEnvelope',
+ iconName: 'envelope',
id: 'send_feedback_info_item',
...feedbackAction,
},
{
text: 'Source Code',
iconClass: 'ui-icon',
- iconName: 'faCode',
+ iconName: 'code',
id: 'source_code_info_item',
href: 'https://github.com/nasa-gibs/worldview',
},
{
text: 'What\'s new',
iconClass: 'ui-icon',
- iconName: 'faFlag',
+ iconName: 'flag',
id: 'whats_new_info_item',
href: 'https://wiki.earthdata.nasa.gov/pages/viewrecentblogposts.action?key=GIBS',
},
{
text: 'About',
iconClass: 'ui-icon',
- iconName: 'faFile',
+ iconName: 'file',
id: 'about_info_item',
onClick: () => {
aboutClick();
@@ -115,7 +115,7 @@ function InfoList (props) {
const exploreWorlviewObj = {
text: 'Explore Worldview',
iconClass: 'ui-icon',
- iconName: 'faTruck',
+ iconName: 'truck',
id: 'start_tour_info_item',
onClick: () => {
startTour(isTourActive);
diff --git a/web/js/containers/projection.js b/web/js/containers/projection.js
index a013c88c0..2b8c9b854 100644
--- a/web/js/containers/projection.js
+++ b/web/js/containers/projection.js
@@ -12,21 +12,21 @@ const DEFAULT_PROJ_ARRAY = [
{
text: 'Arctic',
iconClass: 'ui-icon icon-large',
- iconName: 'faArrowCircleUp',
+ iconName: 'arrow-circle-up',
id: 'change-arctic-button',
key: 'arctic',
},
{
text: 'Geographic',
iconClass: 'ui-icon icon-large',
- iconName: 'faCircle',
+ iconName: 'circle',
id: 'change-geographic-button',
key: 'geographic',
},
{
text: 'Antarctic',
iconClass: 'ui-icon icon-large',
- iconName: 'faArrowCircleDown',
+ iconName: 'arrow-circle-down',
id: 'change-antarctic-button',
key: 'antarctic',
},
diff --git a/web/js/containers/sidebar/layer.js b/web/js/containers/sidebar/layer.js
index 39cbbba4b..a739b119c 100644
--- a/web/js/containers/sidebar/layer.js
+++ b/web/js/containers/sidebar/layer.js
@@ -7,10 +7,6 @@ import { isEmpty as lodashIsEmpty, get as lodashGet } from 'lodash';
import googleTagManager from 'googleTagManager';
import { connect } from 'react-redux';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import {
- faTimes, faSlidersH, faInfo, faBan, faHandPointer,
-} from '@fortawesome/free-solid-svg-icons';
-import { faEye, faEyeSlash } from '@fortawesome/free-regular-svg-icons';
import PaletteLegend from '../../components/sidebar/paletteLegend';
import util from '../../util/util';
import {
@@ -136,7 +132,7 @@ class Layer extends React.Component {
className="button wv-layers-close"
onClick={() => onRemoveClick(layer.id)}
>
- <FontAwesomeIcon icon={faTimes} fixedWidth />
+ <FontAwesomeIcon icon="times" fixedWidth />
</a>
<a
title={`Layer options for ${title}`}
@@ -144,7 +140,7 @@ class Layer extends React.Component {
onMouseDown={this.stopPropagation}
onClick={() => onOptionsClick(layer, title)}
>
- <FontAwesomeIcon icon={faSlidersH} className="wv-layers-options-icon" />
+ <FontAwesomeIcon icon="sliders-h" className="wv-layers-options-icon" />
</a>
<a
title={`Layer description for ${title}`}
@@ -152,7 +148,7 @@ class Layer extends React.Component {
onMouseDown={this.stopPropagation}
onClick={() => onInfoClick(layer, title)}
>
- <FontAwesomeIcon icon={faInfo} className="wv-layers-info-icon" />
+ <FontAwesomeIcon icon="info" className="wv-layers-info-icon" />
</a>
</>
);
@@ -172,7 +168,7 @@ class Layer extends React.Component {
<div title={title} className={runningObject ? `${clasNames} running` : clasNames} onClick={openVectorAlertModal}>
{' '}
<FontAwesomeIcon
- icon={faHandPointer}
+ icon="hand-pointer"
fixedWidth
/>
</div>
@@ -216,10 +212,10 @@ class Layer extends React.Component {
? this.getDisabledTitle(layer)
: 'Hide Layer';
const visibilityIconClass = isDisabled
- ? faBan
+ ? 'ban'
: !isVisible
- ? faEyeSlash
- : faEye;
+ ? ['far', 'eye-slash']
+ : ['far', 'eye'];
return (
<Draggable
diff --git a/web/js/containers/sidebar/orbit-track.js b/web/js/containers/sidebar/orbit-track.js
index 29506c1e3..3a3034a56 100644
--- a/web/js/containers/sidebar/orbit-track.js
+++ b/web/js/containers/sidebar/orbit-track.js
@@ -3,7 +3,6 @@ import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { isEmpty as lodashIsEmpty, get as lodashGet } from 'lodash';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import { faSatellite } from '@fortawesome/free-solid-svg-icons';
import PaletteLegend from '../../components/sidebar/paletteLegend';
import {
getPalette,
@@ -47,7 +46,7 @@ class OrbitTrack extends React.Component {
return (
<div className={containerClasses}>
{hasPalette ? this.getPaletteLegend() : ''}
- <FontAwesomeIcon icon={faSatellite} />
+ <FontAwesomeIcon icon="satellite" />
<span className="wv-orbit-track-label">
{getOrbitTrackTitle(trackLayer)}
</span>
diff --git a/web/js/containers/toolbar.js b/web/js/containers/toolbar.js
index 247a17cd0..6e85ebff7 100644
--- a/web/js/containers/toolbar.js
+++ b/web/js/containers/toolbar.js
@@ -1,7 +1,7 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
-import { ButtonToolbar, Button } from 'reactstrap';
+import { ButtonToolbar, Button, UncontrolledTooltip } from 'reactstrap';
import {
get as lodashGet,
find as lodashFind,
@@ -9,9 +9,6 @@ import {
} from 'lodash';
import Promise from 'bluebird';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
-import {
- faShareSquare, faGlobeAsia, faCamera, faInfoCircle,
-} from '@fortawesome/free-solid-svg-icons';
import { openCustomContent, onToggle } from '../modules/modal/actions';
import toggleDistractionFreeMode from '../modules/ui/actions';
import ImageDownload from './image-download';
@@ -74,6 +71,7 @@ const CUSTOM_MODAL_PROPS = {
clickableBehindModal: true,
},
};
+
class toolbarContainer extends Component {
constructor(props) {
super(props);
@@ -89,39 +87,24 @@ class toolbarContainer extends Component {
return Promise.resolve(type);
}
- openImageDownload() {
+ async openImageDownload() {
const {
openModal, hasCustomPalette, isRotated, hasGraticule, activePalettes, rotation, refreshStateAfterImageDownload,
} = this.props;
const paletteStore = lodashCloneDeep(activePalettes);
- this.getPromise(hasCustomPalette, 'palette', clearCustoms, 'Notice').then(
- () => {
- this.getPromise(
- isRotated,
- 'rotate',
- clearRotate,
- 'Reset rotation',
- ).then(() => {
- this.getPromise(
- hasGraticule,
- 'graticule',
- clearGraticule,
- 'Remove Graticule?',
- ).then(() => {
- openModal(
- 'TOOLBAR_SNAPSHOT',
- {
- ...CUSTOM_MODAL_PROPS.TOOLBAR_SNAPSHOT,
- onClose: () => {
- refreshStateAfterImageDownload(
- hasCustomPalette ? paletteStore : undefined, rotation, hasGraticule,
- );
- },
- },
- );
- });
- });
+ await this.getPromise(hasCustomPalette, 'palette', clearCustoms, 'Notice');
+ await this.getPromise(isRotated, 'rotate', clearRotate, 'Reset rotation');
+ await this.getPromise(hasGraticule, 'graticule', clearGraticule, 'Remove Graticule?');
+ await openModal(
+ 'TOOLBAR_SNAPSHOT',
+ {
+ ...CUSTOM_MODAL_PROPS.TOOLBAR_SNAPSHOT,
+ onClose: () => {
+ refreshStateAfterImageDownload(
+ hasCustomPalette ? paletteStore : undefined, rotation, hasGraticule,
+ );
+ },
},
);
}
@@ -150,88 +133,135 @@ class toolbarContainer extends Component {
}
}
- render() {
+ renderTooltip = (buttonId, labelText) => (
+ <UncontrolledTooltip
+ target={buttonId}
+ boundariesElement="window"
+ placement="bottom"
+ >
+ {labelText}
+ </UncontrolledTooltip>
+ )
+
+ renderShareButton() {
+ const { openModal, isDistractionFreeModeActive } = this.props;
+ const buttonId = 'wv-link-button';
+ const labelText = 'Share this map';
+ return !isDistractionFreeModeActive && (
+ <Button
+ id={buttonId}
+ className="wv-toolbar-button"
+ aria-label={labelText}
+ onClick={() => openModal(
+ 'TOOLBAR_SHARE_LINK',
+ CUSTOM_MODAL_PROPS.TOOLBAR_SHARE_LINK,
+ )}
+ >
+ {this.renderTooltip(buttonId, labelText)}
+ <FontAwesomeIcon icon="share-square" size="2x" />
+ </Button>
+ );
+ }
+
+ renderProjectionButton() {
+ const { config, openModal, isDistractionFreeModeActive } = this.props;
+ const buttonId = 'wv-proj-button';
+ const labelText = 'Switch projection';
+ return config.ui && config.ui.projections && !isDistractionFreeModeActive && (
+ <Button
+ id={buttonId}
+ className="wv-toolbar-button"
+ aria-label={labelText}
+ onClick={() => openModal(
+ 'TOOLBAR_PROJECTION',
+ CUSTOM_MODAL_PROPS.TOOLBAR_PROJECTION,
+ )}
+ >
+ {this.renderTooltip(buttonId, labelText)}
+ <FontAwesomeIcon icon="globe-asia" size="2x" />
+ </Button>
+ );
+ }
+
+ renderSnapshotsButton () {
+ const {
+ isImageDownloadActive,
+ isCompareActive,
+ isDistractionFreeModeActive,
+ } = this.props;
+ const buttonId = 'wv-image-button';
+ const labelText = isCompareActive
+ ? 'You must exit comparison mode to use the snapshot feature'
+ : !isImageDownloadActive
+ ? 'You must exit data download mode to use the snapshot feature'
+ : 'Take a snapshot';
+
+ return !isDistractionFreeModeActive && (
+ <Button
+ id={buttonId}
+ className={
+ isImageDownloadActive
+ ? 'wv-toolbar-button'
+ : 'wv-toolbar-button disabled'
+ }
+ disabled={!isImageDownloadActive}
+ aria-label={labelText}
+ onClick={this.openImageDownload}
+ >
+ {this.renderTooltip(buttonId, labelText)}
+ <FontAwesomeIcon icon="camera" size="2x" />
+ </Button>
+ );
+ }
+
+ renderInfoButton() {
const {
openModal,
notificationType,
notificationContentNumber,
- config,
isDistractionFreeModeActive,
- isImageDownloadActive,
- isCompareActive,
} = this.props;
const notificationClass = notificationType
? ` wv-status-${notificationType}`
: ' wv-status-hide';
+ const buttonId = 'wv-info-button';
+ const labelText = 'Information';
+
+ return (
+ <Button
+ id={buttonId}
+ aria-label={labelText}
+ className={
+ `wv-toolbar-button${notificationClass}
+ ${isDistractionFreeModeActive ? 'wv-info-button-distraction-free-mode' : ''}`
+ }
+ onClick={() => openModal('TOOLBAR_INFO', CUSTOM_MODAL_PROPS.TOOLBAR_INFO)}
+ data-content={notificationContentNumber}
+ >
+ {this.renderTooltip(buttonId, labelText)}
+ <FontAwesomeIcon icon="info-circle" size="2x" />
+ </Button>
+ );
+ }
+
+ render() {
return (
<ErrorBoundary>
<ButtonToolbar
id="wv-toolbar"
className="wv-toolbar"
>
- { !isDistractionFreeModeActive && (
- <>
- <Button
- id="wv-link-button"
- className="wv-toolbar-button"
- title="Share this map"
- onClick={() => openModal(
- 'TOOLBAR_SHARE_LINK',
- CUSTOM_MODAL_PROPS.TOOLBAR_SHARE_LINK,
- )}
- >
- <FontAwesomeIcon icon={faShareSquare} size="2x" />
- </Button>
- {config.ui && config.ui.projections ? (
- <Button
- id="wv-proj-button"
- className="wv-toolbar-button"
- title="Switch projection"
- onClick={() => openModal(
- 'TOOLBAR_PROJECTION',
- CUSTOM_MODAL_PROPS.TOOLBAR_PROJECTION,
- )}
- >
- <FontAwesomeIcon icon={faGlobeAsia} size="2x" />
- </Button>
- )
- : ''}
- <Button
- id="wv-image-button"
- className={
- isImageDownloadActive
- ? 'wv-toolbar-button'
- : 'wv-toolbar-button disabled'
- }
- disabled={!isImageDownloadActive}
- title={
- isCompareActive
- ? 'You must exit comparison mode to use the snapshot feature'
- : !isImageDownloadActive
- ? 'You must exit data download mode to use the snapshot feature'
- : 'Take a snapshot'
- }
- onClick={this.openImageDownload}
- >
- <FontAwesomeIcon icon={faCamera} size="2x" />
- </Button>
- </>
- )}
- <Button
- id="wv-info-button"
- title="Information"
- className={`wv-toolbar-button${notificationClass} ${isDistractionFreeModeActive ? 'wv-info-button-distraction-free-mode' : ''}`}
- onClick={() => openModal('TOOLBAR_INFO', CUSTOM_MODAL_PROPS.TOOLBAR_INFO)}
- data-content={notificationContentNumber}
- >
- <FontAwesomeIcon icon={faInfoCircle} size="2x" />
- </Button>
+ {this.renderShareButton()}
+ {this.renderProjectionButton()}
+ {this.renderSnapshotsButton()}
+ {this.renderInfoButton()}
</ButtonToolbar>
</ErrorBoundary>
);
}
}
-function mapStateToProps(state) {
+
+const mapStateToProps = (state) => {
const {
notifications, palettes, compare, map, layers, proj, data, ui,
} = state;
@@ -262,7 +292,6 @@ function mapStateToProps(state) {
activeLayersForProj,
activePalettes,
),
-
isRotated: Boolean(map.rotation !== 0),
hasGraticule: Boolean(
lodashGet(
@@ -272,7 +301,8 @@ function mapStateToProps(state) {
),
isDistractionFreeModeActive,
};
-}
+};
+
const mapDispatchToProps = (dispatch) => ({
toggleDistractionFreeMode: () => {
dispatch(toggleDistractionFreeMode());
diff --git a/web/js/font-awesome-library.js b/web/js/font-awesome-library.js
new file mode 100644
index 000000000..a4f691499
--- /dev/null
+++ b/web/js/font-awesome-library.js
@@ -0,0 +1,134 @@
+/*
+ Provides a single import location for font-awesome icons. This allows us
+ to simply import the FontAwesomeIcon component where we want to display
+ an icon and only pass the string name of an icon.
+
+ For example:
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
+ <FontAwesomeIcon icon="times" fixedWidth />
+
+ Icons that belong to a package other than '@fortawesome/free-solid-svg-icons'
+ need to be defined as an array of strings where thee first element is the
+ package abbreviation. For example an icon from '@fortawesome/free-brands-svg-icons'
+ becomes:
+ <FontAwesomeIcon icon={['fab', 'facebook-f']} />
+
+*/
+
+import {
+ faArrowCircleDown,
+ faArrowCircleLeft,
+ faArrowCircleRight,
+ faArrowCircleUp,
+ faArrowLeft,
+ faArrowRight,
+ faBan,
+ faBolt,
+ faCamera,
+ faCaretDown,
+ faCaretRight,
+ faCheckCircle,
+ faChevronCircleDown,
+ faChevronCircleRight,
+ faChevronDown,
+ faChevronUp,
+ faCircle,
+ faClock,
+ faCode,
+ faDownload,
+ faEnvelope,
+ faExclamationCircle,
+ faExclamationTriangle,
+ faExternalLinkAlt,
+ faFile,
+ faFileVideo,
+ faFilter,
+ faFlag,
+ faGift,
+ faGlobeAmericas,
+ faGlobeAsia,
+ faHandPointer,
+ faInfo,
+ faInfoCircle,
+ faLayerGroup,
+ faMap,
+ faMinus,
+ faMeteor,
+ faPause,
+ faPlay,
+ faPlus,
+ faQuestionCircle,
+ faRetweet,
+ faRuler,
+ faRulerCombined,
+ faSatellite,
+ faShareSquare,
+ faSlidersH,
+ faTimes,
+ faTrash,
+ faTruck,
+ faVideo,
+} from '@fortawesome/free-solid-svg-icons';
+import { faFacebookF, faTwitter, faRedditAlien } from '@fortawesome/free-brands-svg-icons';
+import { faEye, faEyeSlash } from '@fortawesome/free-regular-svg-icons';
+import { library } from '@fortawesome/fontawesome-svg-core';
+
+library.add(
+ faArrowCircleDown,
+ faArrowCircleLeft,
+ faArrowCircleRight,
+ faArrowCircleUp,
+ faArrowLeft,
+ faArrowRight,
+ faBan,
+ faBolt,
+ faCamera,
+ faCaretDown,
+ faCaretRight,
+ faCheckCircle,
+ faChevronCircleDown,
+ faChevronCircleRight,
+ faChevronDown,
+ faChevronUp,
+ faCircle,
+ faClock,
+ faCode,
+ faDownload,
+ faEnvelope,
+ faExclamationCircle,
+ faExclamationTriangle,
+ faExternalLinkAlt,
+ faEye,
+ faEyeSlash,
+ faFacebookF,
+ faFile,
+ faFileVideo,
+ faFilter,
+ faFlag,
+ faGift,
+ faGlobeAmericas,
+ faGlobeAsia,
+ faHandPointer,
+ faInfo,
+ faInfoCircle,
+ faLayerGroup,
+ faMap,
+ faMinus,
+ faMeteor,
+ faPause,
+ faPlay,
+ faPlus,
+ faQuestionCircle,
+ faRetweet,
+ faRedditAlien,
+ faRuler,
+ faRulerCombined,
+ faSatellite,
+ faShareSquare,
+ faSlidersH,
+ faTimes,
+ faTrash,
+ faTruck,
+ faTwitter,
+ faVideo,
+);