Merge pull request #170 from jaredpalmer/titles
Add titles to shape buttons with key shortcuts
This commit is contained in:
commit
91bc9df37a
@ -886,6 +886,11 @@ const SHAPES = [
|
|||||||
|
|
||||||
const shapesShortcutKeys = SHAPES.map(shape => shape.value[0]);
|
const shapesShortcutKeys = SHAPES.map(shape => shape.value[0]);
|
||||||
|
|
||||||
|
|
||||||
|
function capitalize(str: string) {
|
||||||
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
||||||
|
}
|
||||||
|
|
||||||
function findElementByKey(key: string) {
|
function findElementByKey(key: string) {
|
||||||
const defaultElement = "selection";
|
const defaultElement = "selection";
|
||||||
return SHAPES.reduce((element, shape) => {
|
return SHAPES.reduce((element, shape) => {
|
||||||
@ -1126,7 +1131,7 @@ class App extends React.Component<{}, AppState> {
|
|||||||
<h4>Shapes</h4>
|
<h4>Shapes</h4>
|
||||||
<div className="panelTools">
|
<div className="panelTools">
|
||||||
{SHAPES.map(({ value, icon }) => (
|
{SHAPES.map(({ value, icon }) => (
|
||||||
<label key={value} className="tool">
|
<label key={value} className="tool" title={`${capitalize(value)} - ${capitalize(value)[0]}`}>
|
||||||
<input
|
<input
|
||||||
type="radio"
|
type="radio"
|
||||||
checked={this.state.elementType === value}
|
checked={this.state.elementType === value}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user