-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(url): sync selected layers state to url (#196)
* feat(url): sync selected layers state to url * feat(url): sync selected layers state to url * refactor(layers): rename selectors
- Loading branch information
1 parent
f9750e2
commit 82276e4
Showing
19 changed files
with
207 additions
and
233 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,24 @@ | ||
import React, {FunctionComponent} from 'react'; | ||
import {useSelector} from 'react-redux'; | ||
|
||
import {selectedLayersSelector} from '../../selectors/layers/selected'; | ||
import RemoveCompare from '../remove-compare/remove-compare'; | ||
import InfoButton from '../info-button/info-button'; | ||
|
||
import styles from './data-set-info.styl'; | ||
import {LayerListItem} from '../../types/layer-list'; | ||
|
||
interface Props { | ||
isMain?: boolean; | ||
layer: LayerListItem | null; | ||
} | ||
|
||
const DataSetInfo: FunctionComponent<Props> = ({isMain}) => { | ||
const {main, compare} = useSelector(selectedLayersSelector); | ||
const layer = isMain ? main : compare; | ||
|
||
return ( | ||
<div className={styles.dataSetInfo}> | ||
<h1 className={styles.title}>{layer && layer.name}</h1> | ||
<h2 className={styles.description}>{layer && layer.description}</h2> | ||
<div className={styles.buttons}> | ||
<InfoButton layer={layer} /> | ||
{!isMain && <RemoveCompare />} | ||
</div> | ||
const DataSetInfo: FunctionComponent<Props> = ({layer, isMain}) => ( | ||
<div className={styles.dataSetInfo}> | ||
<h1 className={styles.title}>{layer && layer.name}</h1> | ||
<h2 className={styles.description}>{layer && layer.description}</h2> | ||
<div className={styles.buttons}> | ||
<InfoButton layer={layer} /> | ||
{!isMain && <RemoveCompare />} | ||
</div> | ||
); | ||
}; | ||
</div> | ||
); | ||
|
||
export default DataSetInfo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.