import React, { Component } from 'react'; import Button from './Button.js'; import Popup from './Popup.js'; import globalData from '../GlobalData.js'; import './css/StopTitle.css'; class StopTitle extends Component { constructor(props) { super(props); this.popupElem = React.createRef(); } showPopup = () => { this.popupElem.current.show(); }; hidePopup = () => { this.popupElem.current.hide(); }; setTrackA = () => { globalData.user.track = "A"; }; setTrackB = () => { globalData.user.track = "B"; }; updatePage = () => { globalData.currentPage.forceUpdate(); } render() { return (

Välj läge:

{this.props.stop.name !== undefined ? this.props.stop.name : "Hållplats saknas" }

{this.props.stop.name !== undefined && this.props.stop.track !== undefined ?

{"Läge " + globalData.user.track}

: (this.props.stop.name !== undefined ? <> :

Vänligen aktivera platsåtkomst

) }
); } } export default StopTitle;