diff --git a/imports/ui/pages/FiresMap/FireStats.js b/imports/ui/pages/FiresMap/FireStats.js new file mode 100644 index 0000000..67ae789 --- /dev/null +++ b/imports/ui/pages/FiresMap/FireStats.js @@ -0,0 +1,29 @@ +/* eslint-disable react/jsx-indent-props */ +/* eslint-disable import/no-absolute-path */ +/* eslint-disable import/no-absolute-path */ + +import React, { Component, Fragment } from 'react'; +import PropTypes from 'prop-types'; +import { translate, Trans } from 'react-i18next'; +import FromNow from '/imports/ui/components/FromNow/FromNow'; + +class FireStats extends Component { + render() { + return ( + + { this.props.lastCheck && this.props.lastFireDetected && + Actualizado , Ășltimo fuego detectado .} + + ); + } +} + +FireStats.propTypes = { + lastFireDetected: PropTypes.object, + lastCheck: PropTypes.instanceOf(Date) +}; + +FireStats.defaultProps = { +}; + +export default translate([], { wait: true })(FireStats); diff --git a/imports/ui/pages/FiresMap/FiresMap.js b/imports/ui/pages/FiresMap/FiresMap.js index f1fe788..74b3399 100644 --- a/imports/ui/pages/FiresMap/FiresMap.js +++ b/imports/ui/pages/FiresMap/FiresMap.js @@ -37,7 +37,7 @@ import ShareIt from '/imports/ui/components/ShareIt/ShareIt'; import FullScreenMap from '/imports/ui/components/Maps/FullScreenMap'; import LocationAutocomplete from '/imports/ui/components/LocationAutocomplete/LocationAutocomplete'; import Gkeys from '/imports/startup/client/Gkeys'; - +import FireStats from './FireStats'; import './FiresMap.scss'; const MAXZOOM = 6; @@ -74,7 +74,6 @@ class FiresMap extends React.Component { this.onViewportChanged = this.onViewportChanged.bind(this); this.onMoveEnd = this.onMoveEnd.bind(this); this.onMoveStart = this.onMoveStart.bind(this); - this.fireStats = this.fireStats.bind(this); } componentDidMount() { @@ -196,15 +195,6 @@ class FiresMap extends React.Component { } } - fireStats() { - return ( - - { this.props.lastCheck && this.props.lastFireDetected && - Actualizado , Ășltimo fuego detectado .} - - ); - } - render() { const { t } = this.props; console.log(`Rendering ${this.props.loading ? 'loading' : 'LOADED'}, zoom ${this.state.viewport.zoom}, map ${this.props.activefires.length + this.props.firealerts.length} of ${this.props.activefirestotal} total. False positives: ${this.props.falsePositives.length}. Reactive ${this.state.viewport.zoom >= MAXZOOMREACTIVE}`); @@ -253,8 +243,8 @@ class FiresMap extends React.Component {

{ (this.props.activefires.length + this.props.firealerts.length) === 0 ? - No hay fuegos activos en esta zona del mapa. {{ countTotal: this.props.activefirestotal }} fuegos activos en el mundo. {this.fireStats()} : - En rojo, {{ count: this.props.activefires.length + this.props.firealerts.length }} fuegos activos. {{ countTotal: this.props.activefirestotal }} fuegos activos en el mundo. {this.fireStats()} + No hay fuegos activos en esta zona del mapa. {{ countTotal: this.props.activefirestotal }} fuegos activos en el mundo. : + En rojo, {{ count: this.props.activefires.length + this.props.firealerts.length }} fuegos activos. {{ countTotal: this.props.activefirestotal }} fuegos activos en el mundo. }

{isNotHomeAndMobile() && this.props.firealerts.length > 0 &&