Added measure tool

This commit is contained in:
Mitchell McCaffrey
2020-06-26 12:23:06 +10:00
parent dfce8dee05
commit 57754e0ac8
10 changed files with 305 additions and 2 deletions

View File

@@ -0,0 +1,41 @@
import React from "react";
import { Flex } from "theme-ui";
import ToolSection from "./ToolSection";
import MeasureChebyshevIcon from "../../../icons/MeasureChebyshevIcon";
import MeasureEuclideanIcon from "../../../icons/MeasureEuclideanIcon";
import MeasureManhattanIcon from "../../../icons/MeasureManhattanIcon";
function MeasureToolSettings({ settings, onSettingChange }) {
const tools = [
{
id: "chebyshev",
title: "Grid Distance",
isSelected: settings.type === "chebyshev",
icon: <MeasureChebyshevIcon />,
},
{
id: "euclidean",
title: "Line Distance",
isSelected: settings.type === "euclidean",
icon: <MeasureEuclideanIcon />,
},
{
id: "manhattan",
title: "City Block Distance",
isSelected: settings.type === "manhattan",
icon: <MeasureManhattanIcon />,
},
];
return (
<Flex sx={{ alignItems: "center" }}>
<ToolSection
tools={tools}
onToolClick={(tool) => onSettingChange({ type: tool.id })}
/>
</Flex>
);
}
export default MeasureToolSettings;