refactor: Stop using the deprecated keyCode (#2426)

Co-authored-by: Lipis <lipiridis@gmail.com>
Co-authored-by: David Luzar <luzar.david@gmail.com>
This commit is contained in:
Lipis 2020-12-01 23:36:06 +02:00 committed by GitHub
parent 58fcb44de0
commit 014097a97e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 257 additions and 281 deletions

View file

@ -1,4 +1,5 @@
import React from "react";
import { KEYS } from "./keys";
// We inline font-awesome icons in order to save on js size rather than including the font awesome react library
export const SHAPES = [
@ -10,7 +11,7 @@ export const SHAPES = [
</svg>
),
value: "selection",
key: ["v", "s"],
key: [KEYS.V, KEYS.S],
},
{
icon: (
@ -20,7 +21,7 @@ export const SHAPES = [
</svg>
),
value: "rectangle",
key: "r",
key: KEYS.R,
},
{
icon: (
@ -30,7 +31,7 @@ export const SHAPES = [
</svg>
),
value: "diamond",
key: "d",
key: KEYS.D,
},
{
icon: (
@ -40,7 +41,7 @@ export const SHAPES = [
</svg>
),
value: "ellipse",
key: "e",
key: KEYS.E,
},
{
icon: (
@ -50,7 +51,7 @@ export const SHAPES = [
</svg>
),
value: "arrow",
key: "a",
key: KEYS.A,
},
{
icon: (
@ -67,7 +68,7 @@ export const SHAPES = [
</svg>
),
value: "line",
key: ["p", "l"],
key: [KEYS.P, KEYS.L],
},
{
icon: (
@ -80,7 +81,7 @@ export const SHAPES = [
</svg>
),
value: "draw",
key: ["P", "x"],
key: KEYS.X,
},
{
icon: (
@ -90,7 +91,7 @@ export const SHAPES = [
</svg>
),
value: "text",
key: "t",
key: KEYS.T,
},
] as const;