Partipe btn and link

This commit is contained in:
vjrj 2018-01-25 16:53:50 +01:00
parent 31e7810d5f
commit 9fafc17749
3 changed files with 32 additions and 4 deletions

View file

@ -126,6 +126,7 @@
.slide-1-icon:before { .slide-1-icon:before {
content: ""; content: "";
cursor: pointer;
} }
.slide-2-icon { .slide-2-icon {

View file

@ -68,6 +68,13 @@ class Index extends Component {
window.open('https://t.me/TodosContraElFuego_bot', '_blank'); window.open('https://t.me/TodosContraElFuego_bot', '_blank');
} }
gotoParticipe() {
const element = document.querySelector('#participe');
if (element) {
element.scrollIntoView();
}
}
render() { render() {
return ( return (
<div className="IndexDisabled full-width"> <div className="IndexDisabled full-width">
@ -79,10 +86,10 @@ class Index extends Component {
<div <div
id="carouselExampleIndicators" id="carouselExampleIndicators"
className="carousel slide" className="carousel slide"
data-interval={false}
ref={(ref) => { this.slides = ref; }} ref={(ref) => { this.slides = ref; }}
> >
{/* for dev: data-interval=false */} {/* for dev ^^^: data-interval=false */}
<ol className="carousel-indicators"> <ol className="carousel-indicators">
<li data-target="#carouselExampleIndicators" data-slide-to="0" className="active" /> <li data-target="#carouselExampleIndicators" data-slide-to="0" className="active" />
<li data-target="#carouselExampleIndicators" data-slide-to="1" /> <li data-target="#carouselExampleIndicators" data-slide-to="1" />
@ -92,7 +99,13 @@ class Index extends Component {
<div className="carousel-inner" role="listbox"> <div className="carousel-inner" role="listbox">
<div className="carousel-item carousel-item-1 active"> <div className="carousel-item carousel-item-1 active">
<div className="slide-1-icon" /> <div
tabIndex={0}
role="button"
className="slide-1-icon"
onKeyDown={() => { this.gotoParticipe(); }}
onClick={() => { this.gotoParticipe(); }}
/>
<div className="carousel-caption"> <div className="carousel-caption">
<h3><Trans>Elige un lugar</Trans></h3> <h3><Trans>Elige un lugar</Trans></h3>
<p /> <p />
@ -164,6 +177,7 @@ class Index extends Component {
</div> </div>
</section> </section>
<a id="participe" name="participe" />
<section className="sect4"> <section className="sect4">
<div className="container"> <div className="container">
<h4 className="page-header"><Trans parent="span">Suscríbete a alertas de fuegos</Trans></h4> <h4 className="page-header"><Trans parent="span">Suscríbete a alertas de fuegos</Trans></h4>

View file

@ -4,7 +4,7 @@
/* eslint-disable react/jsx-indent */ /* eslint-disable react/jsx-indent */
import React, { Fragment } from 'react'; import React, { Fragment } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { ButtonGroup, Row, Col } from 'react-bootstrap'; import { Button, ButtonGroup, Row, Col } from 'react-bootstrap';
import { Meteor } from 'meteor/meteor'; import { Meteor } from 'meteor/meteor';
import { withTracker } from 'meteor/react-meteor-data'; import { withTracker } from 'meteor/react-meteor-data';
import { Trans, translate } from 'react-i18next'; import { Trans, translate } from 'react-i18next';
@ -74,6 +74,13 @@ class SubscriptionsMap extends React.Component {
this.setState({ init: false, viewport }); this.setState({ init: false, viewport });
} }
gotoParticipe() {
const element = document.querySelector('#participe');
if (element) {
element.scrollIntoView();
}
}
render() { render() {
console.log(`Rendering Subs users ready ${this.props.subsready} subs: ${this.props.userSubs.length} viewport: ${JSON.stringify(this.state.viewport)}`); console.log(`Rendering Subs users ready ${this.props.subsready} subs: ${this.props.userSubs.length} viewport: ${JSON.stringify(this.state.viewport)}`);
return ( return (
@ -111,6 +118,12 @@ class SubscriptionsMap extends React.Component {
<Control position="topright" > <Control position="topright" >
<ButtonGroup> <ButtonGroup>
<CenterInMyPosition onClick={viewport => this.centerOnUserLocation(viewport)} onlyIcon {... this.props} /> <CenterInMyPosition onClick={viewport => this.centerOnUserLocation(viewport)} onlyIcon {... this.props} />
<Button
bsStyle="success"
onClick={() => { this.gotoParticipe(); }}
>
{this.props.t('Participa')}
</Button>
</ButtonGroup> </ButtonGroup>
</Control> </Control>
</Map> </Map>