Removed modes from note tool

This commit is contained in:
Mitchell McCaffrey
2020-11-05 12:28:28 +11:00
parent a3ae3471e8
commit dcdbb1ea98
7 changed files with 46 additions and 84 deletions

View File

@@ -1,47 +0,0 @@
import React from "react";
import { Flex } from "theme-ui";
import ToolSection from "./ToolSection";
import NoteAddIcon from "../../../icons/NoteAddIcon";
import MoveIcon from "../../../icons/MoveIcon";
import useKeyboard from "../../../helpers/useKeyboard";
function NoteToolSettings({ settings, onSettingChange }) {
// Keyboard shortcuts
function handleKeyDown({ key }) {
if (key === "a") {
onSettingChange({ type: "add" });
} else if (key === "v") {
onSettingChange({ type: "move" });
}
}
useKeyboard(handleKeyDown);
const tools = [
{
id: "add",
title: "Add Note (A)",
isSelected: settings.type === "add",
icon: <NoteAddIcon />,
},
{
id: "move",
title: "Move Note (V)",
isSelected: settings.type === "move",
icon: <MoveIcon />,
},
];
return (
<Flex sx={{ alignItems: "center" }}>
<ToolSection
tools={tools}
onToolClick={(tool) => onSettingChange({ type: tool.id })}
/>
</Flex>
);
}
export default NoteToolSettings;