Refactorization
This commit is contained in:
parent
f6453c77d7
commit
5e5724e535
1 changed files with 15 additions and 15 deletions
|
|
@ -7,19 +7,21 @@ import FireCircleMark from '/imports/ui/components/Maps/FireCircleMark';
|
||||||
import FireIconMark from '/imports/ui/components/Maps/FireIconMark';
|
import FireIconMark from '/imports/ui/components/Maps/FireIconMark';
|
||||||
import FirePixel from '/imports/ui/components/Maps/FirePixel';
|
import FirePixel from '/imports/ui/components/Maps/FirePixel';
|
||||||
|
|
||||||
const FireList = ({
|
export default function FireList(props) {
|
||||||
fires,
|
const {
|
||||||
scale,
|
fires, scale, useMarkers, nasa
|
||||||
useMarkers,
|
} = props;
|
||||||
nasa }) => {
|
const items = fires.map(({ _id, ...otherProps }) => {
|
||||||
const items = fires.map(({ _id, ...props }) => (
|
if (useMarkers && scale) {
|
||||||
(useMarkers && scale) ?
|
return (<FireIconMark key={_id} nasa={nasa} {...otherProps} />);
|
||||||
<FireIconMark key={_id} nasa={nasa} {...props} /> :
|
}
|
||||||
(!nasa && !scale) ?
|
if (!nasa && !scale) {
|
||||||
<FirePixel key={_id} nasa={nasa} {...props} /> :
|
return (<FirePixel key={_id} nasa={nasa} {...otherProps} />);
|
||||||
<FireCircleMark key={_id} nasa={nasa} {...props} />));
|
}
|
||||||
return <div style={{ display: 'none' }}>{items}</div>;
|
return (<FireCircleMark key={_id} nasa={nasa} {...otherProps} />);
|
||||||
};
|
});
|
||||||
|
return (<div style={{ display: 'none' }}>{items}</div>);
|
||||||
|
}
|
||||||
|
|
||||||
FireList.propTypes = {
|
FireList.propTypes = {
|
||||||
fires: PropTypes.array.isRequired,
|
fires: PropTypes.array.isRequired,
|
||||||
|
|
@ -27,5 +29,3 @@ FireList.propTypes = {
|
||||||
useMarkers: PropTypes.bool.isRequired,
|
useMarkers: PropTypes.bool.isRequired,
|
||||||
nasa: PropTypes.bool.isRequired
|
nasa: PropTypes.bool.isRequired
|
||||||
};
|
};
|
||||||
|
|
||||||
export default FireList;
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue