Cursor: desktoip only

This commit is contained in:
muerwre 2019-02-25 17:36:01 +07:00
parent 2abf8ca580
commit 09a36bab6c
2 changed files with 12 additions and 7 deletions

View file

@ -30,7 +30,7 @@ export class Cursor extends React.PureComponent<Props, {}> {
const activeSticker = (sticker && set && STICKERS[set] && STICKERS[set].layers[sticker]);
return (
<div className="cursor-tooltip" ref={el => { this.cursor = el; }}>
<div className="cursor-tooltip desktop-only" ref={el => { this.cursor = el; }}>
{ mode === MODES.ROUTER && <Icon icon="icon-router" />}
{ mode === MODES.POLY && <Icon icon="icon-poly" />}
{ mode === MODES.STICKERS && activeSticker && <StickerIcon sticker={sticker} set={set} /> }

View file

@ -8,6 +8,7 @@ import { bindActionCreators } from 'redux';
import { setSpeed } from '$redux/user/actions';
import { IRootState } from "$redux/user/reducer";
import { Tooltip } from "$components/panels/Tooltip";
import { isMobile } from "$utils/window";
interface Props extends IRootState {
setSpeed: typeof setSpeed,
@ -34,7 +35,11 @@ class Component extends React.PureComponent<Props, State> {
[this.min + (index * this.step)]: String(this.min + (index * this.step)),
}), { });
toggleDialog = () => this.setState({ dialogOpened: !this.state.dialogOpened });
toggleDialog = () => {
if (isMobile()) return;
this.setState({ dialogOpened: !this.state.dialogOpened });
};
render() {
const {
@ -46,13 +51,13 @@ class Component extends React.PureComponent<Props, State> {
return (
<React.Fragment>
<div className="status-bar padded desktop-only pointer tooltip-container" onClick={this.toggleDialog}>
<div className="status-bar padded pointer tooltip-container" onClick={this.toggleDialog}>
{distance} км&nbsp;
<Tooltip position="top">Примерное время</Tooltip>
<span className="desktop-only">
<Icon icon="icon-cycle" size={32} />
{
<span>{toHours(estimated)}</span>
}
</span>
<span className="desktop-only">{toHours(estimated)}</span>
</div>
{
dialogOpened &&