make circle radius larger on mobile only (#11210)

This commit is contained in:
Josh Hawkins 2024-05-02 14:06:32 -05:00 committed by GitHub
parent a3267f7d44
commit 7a5df6045a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -9,6 +9,7 @@ import {
import type { KonvaEventObject } from "konva/lib/Node";
import Konva from "konva";
import { Vector2d } from "konva/lib/types";
import { isMobileOnly } from "react-device-detect";
type PolygonDrawerProps = {
points: number[][];
@ -45,7 +46,7 @@ export default function PolygonDrawer({
handleMouseOverAnyPoint,
handleMouseOutAnyPoint,
}: PolygonDrawerProps) {
const vertexRadius = 6;
const vertexRadius = isMobileOnly ? 12 : 6;
const flattenedPoints = useMemo(() => flattenPoints(points), [points]);
const [stage, setStage] = useState<Konva.Stage>();
const [minMaxX, setMinMaxX] = useState([0, 0]);