FiresMap refactor
This commit is contained in:
parent
c025ec5ce8
commit
6e0282d679
1 changed files with 53 additions and 52 deletions
|
|
@ -152,7 +152,7 @@ class FiresMap extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
centerOnUserLocation(viewport) {
|
centerOnUserLocation(viewport) {
|
||||||
this.setState({ viewport });
|
this.setState({ viewport: { center: viewport.center, zoom: 10 } });
|
||||||
}
|
}
|
||||||
|
|
||||||
useMarkers(use) {
|
useMarkers(use) {
|
||||||
|
|
@ -220,18 +220,6 @@ class FiresMap extends React.Component {
|
||||||
</Helmet> }
|
</Helmet> }
|
||||||
<h4 className="page-header"><Trans parent="span">Fuegos activos</Trans></h4>
|
<h4 className="page-header"><Trans parent="span">Fuegos activos</Trans></h4>
|
||||||
<Row>
|
<Row>
|
||||||
<Col xs={12} sm={6} md={6} lg={6} >
|
|
||||||
<p className="firesmap-legend">
|
|
||||||
{ (this.props.activefires.length + this.props.firealerts.length) === 0 ?
|
|
||||||
<Fragment><Trans parent="span" i18nKey="noActiveFireInMapCount">No hay fuegos activos en esta zona del mapa. <strong>{{ countTotal: this.props.activefirestotal }}</strong> fuegos activos en el mundo.</Trans> <Trans>Actualizado <FromNow when={this.props.lastCheck} />.</Trans></Fragment> :
|
|
||||||
<Fragment><Trans parent="span" i18nKey="activeFireInMapCount">En rojo, <strong>{{ count: this.props.activefires.length + this.props.firealerts.length }}</strong> fuegos activos. <strong>{{ countTotal: this.props.activefirestotal }}</strong> fuegos activos en el mundo.</Trans> <Trans>Actualizado <FromNow when={this.props.lastCheck} />.</Trans></Fragment>
|
|
||||||
}
|
|
||||||
</p>
|
|
||||||
{isNotHomeAndMobile() && this.props.firealerts.length > 0 &&
|
|
||||||
<p className="firesmap-legend"><Trans parent="span" i18nKey="activeNeigFireInMapCount">En naranja, los fuegos notificados por nuestros usuarios/as recientemente.</Trans></p> }
|
|
||||||
{isNotHomeAndMobile() && this.props.firealerts.length === 0 && !isAnyMobile &&
|
|
||||||
<p className="firesmap-legend"><Trans parent="span" i18nKey="noActiveNeigFireInMap">No hay fuegos notificados recientemente por nuestros usuarios/as en esta zona.</Trans></p> }
|
|
||||||
</Col>
|
|
||||||
<Col xs={12} sm={6} md={6} lg={6}>
|
<Col xs={12} sm={6} md={6} lg={6}>
|
||||||
{isNotHomeAndMobile() &&
|
{isNotHomeAndMobile() &&
|
||||||
<Fragment>
|
<Fragment>
|
||||||
|
|
@ -250,6 +238,19 @@ class FiresMap extends React.Component {
|
||||||
<Trans className="mark-checkbox" parent="span">Resaltar los fuegos con un marcador</Trans>
|
<Trans className="mark-checkbox" parent="span">Resaltar los fuegos con un marcador</Trans>
|
||||||
</Checkbox>}
|
</Checkbox>}
|
||||||
</Fragment>}
|
</Fragment>}
|
||||||
|
</Col>
|
||||||
|
<Col xs={12} sm={6} md={6} lg={6} >
|
||||||
|
<p className="firesmap-legend">
|
||||||
|
{ (this.props.activefires.length + this.props.firealerts.length) === 0 ?
|
||||||
|
<Fragment><Trans parent="span" i18nKey="noActiveFireInMapCount">No hay fuegos activos en esta zona del mapa. <strong>{{ countTotal: this.props.activefirestotal }}</strong> fuegos activos en el mundo.</Trans> <Trans>Actualizado <FromNow when={this.props.lastCheck} />.</Trans></Fragment> :
|
||||||
|
<Fragment><Trans parent="span" i18nKey="activeFireInMapCount">En rojo, <strong>{{ count: this.props.activefires.length + this.props.firealerts.length }}</strong> fuegos activos. <strong>{{ countTotal: this.props.activefirestotal }}</strong> fuegos activos en el mundo.</Trans> <Trans>Actualizado <FromNow when={this.props.lastCheck} />.</Trans></Fragment>
|
||||||
|
}
|
||||||
|
</p>
|
||||||
|
{isNotHomeAndMobile() && this.props.firealerts.length > 0 &&
|
||||||
|
<p className="firesmap-legend"><Trans parent="span" i18nKey="activeNeigFireInMapCount">En naranja, los fuegos notificados por nuestros usuarios/as recientemente.</Trans></p> }
|
||||||
|
{ /* disabled */ false && isNotHomeAndMobile() && this.props.firealerts.length === 0 && !isAnyMobile &&
|
||||||
|
<p className="firesmap-legend"><Trans parent="span" i18nKey="noActiveNeigFireInMap">No hay fuegos notificados recientemente por nuestros usuarios/as en esta zona.</Trans></p> }
|
||||||
|
|
||||||
<p className="firesmap-note">
|
<p className="firesmap-note">
|
||||||
<em>{ this.state.viewport.zoom >= MAXZOOMREACTIVE ?
|
<em>{ this.state.viewport.zoom >= MAXZOOMREACTIVE ?
|
||||||
<Trans>Los fuegos activos se actualizan en tiempo cuasi real.</Trans> :
|
<Trans>Los fuegos activos se actualizan en tiempo cuasi real.</Trans> :
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue