Hide zoom buttons on small screens

This commit is contained in:
Przemek Wiech
2020-03-16 23:02:00 +01:00
parent 73dceaaae0
commit 3650082386

View File

@@ -14,6 +14,7 @@ import {
FancyChart, FancyChart,
CircleRenderer, CircleRenderer,
} from 'topola'; } from 'topola';
import { Responsive } from 'semantic-ui-react';
/** How much to zoom when using the +/- buttons. */ /** How much to zoom when using the +/- buttons. */
const ZOOM_FACTOR = 1.3; const ZOOM_FACTOR = 1.3;
@@ -309,7 +310,7 @@ export class Chart extends React.PureComponent<ChartProps, {}> {
return ( return (
<div id="svgContainer"> <div id="svgContainer">
{this.props.enableZoom ? ( {this.props.enableZoom ? (
<div className="zoom"> <Responsive minWidth={768} className="zoom">
<button className="zoom-in" onClick={() => this.zoom(ZOOM_FACTOR)}> <button className="zoom-in" onClick={() => this.zoom(ZOOM_FACTOR)}>
+ +
</button> </button>
@@ -319,7 +320,7 @@ export class Chart extends React.PureComponent<ChartProps, {}> {
> >
</button> </button>
</div> </Responsive>
) : null} ) : null}
<svg id="chartSvg"> <svg id="chartSvg">
<g id="chart" /> <g id="chart" />