change selection/line/draw shortcut defaults (#1953)

This commit is contained in:
David Luzar 2020-07-24 15:47:46 +02:00 committed by GitHub
parent c5d37a07c8
commit dc1f6c4d4c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 22 deletions

View file

@ -104,9 +104,11 @@ export const ShapesSwitcher = ({
<>
{SHAPES.map(({ value, icon, key }, index) => {
const label = t(`toolBar.${value}`);
const shortcut = `${capitalizeString(key)} ${t("shortcutsDialog.or")} ${
index + 1
}`;
const letter = typeof key === "string" ? key : key[0];
const letterShortcut = /[a-z]/.test(letter) ? letter : `Shift+${letter}`;
const shortcut = `${capitalizeString(letterShortcut)} ${t(
"shortcutsDialog.or",
)} ${index + 1}`;
return (
<ToolButton
className="Shape"