mirror of
https://github.com/PeWu/topola-viewer.git
synced 2026-04-11 00:56:16 +00:00
Hide zoom buttons on small screens
This commit is contained in:
@@ -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" />
|
||||||
|
|||||||
Reference in New Issue
Block a user